Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2004.02.25;
Скачать: [xml.tar.bz2];

Вниз

подскажите пожалуйста, как   Найти похожие ветки 

 
человек в сети   (2004-02-12 00:55) [0]

subj. есть кнопка и есть звук в файле *.wav ... как бы сделать так, чтобы при нажатии на кнопку я услышал звук из муз. файла? заранее спасибо :)


 
Rouse_   (2004-02-12 01:06) [1]

The PlaySound function plays a sound specified by a file name, resource, or system event.

BOOL WINAPI PlaySound(
LPCSTR pszSound,
HMODULE hmod,
DWORD fdwSound );
Parameters
pszSound
Pointer to a null-terminated string that specifies the sound to play. If this parameter is NULL, any currently playing waveform sound is stopped. To stop a non-waveform sound, specify SND_PURGE in the fdwSound parameter.
Three flags in fdwSound (SND_ALIAS, SND_FILENAME, and SND_RESOURCE) determine whether the name is interpreted as an alias for a system event, a filename, or a resource identifier. If none of these flags are specified, PlaySound searches the registry or the WIN.INI file for an association with the specified sound name. If an association is found, the sound event is played. If no association is found in the registry, the name is interpreted as a filename.

hmod
Handle to the executable file that contains the resource to be loaded. This parameter must be NULL unless SND_RESOURCE is specified in fdwSound.
fdwSound
Flags for playing the sound. The following values are defined:
Value Description
SND_APPLICATION The sound is played using an application-specific association.
SND_ALIAS The pszSound parameter is a system-event alias in the registry or the WIN.INI file. Do not use with either SND_FILENAME or SND_RESOURCE.
SND_ASYNC The sound is played asynchronously and PlaySound returns immediately after beginning the sound. To terminate an asynchronously played waveform sound, call PlaySound with pszSound set to NULL.
SND_FILENAME The pszSound parameter is a filename.
SND_LOOP The sound plays repeatedly until PlaySound is called again with the pszSound parameter set to NULL. You must also specify the SND_ASYNC flag to indicate an asynchronous sound event.
SND_MEMORY A sound event’s file is loaded in RAM. The parameter specified by pszSound must point to an image of a sound in memory.
SND_NODEFAULT No default sound event is used. If the sound cannot be found, PlaySound returns silently without playing the default sound.
SND_NOSTOP The specified sound event will yield to another sound event that is already playing. If a sound cannot be played because the resource needed to generate that sound is busy playing another sound, the function immediately returns FALSE without playing the requested sound.
If this flag is not specified, PlaySound attempts to stop the currently playing sound so that the device can be used to play the new sound.

SND_NOWAIT If the driver is busy, return immediately without playing the sound.
SND_RESOURCE The pszSound parameter is a resource identifier; hmod must identify the instance that contains the resource.
SND_SYNC Synchronous playback of a sound event. PlaySound returns after the sound event completes.

Return Values
TRUE indicates success. FALSE indicates failure.


 
Rouse_   (2004-02-12 01:08) [2]

Так же есть sndPlaySound

BOOL sndPlaySound(
LPCSTR lpszSound,
UINT fuSound
);


 
человек в сети   (2004-02-12 03:23) [3]

... и всё-таки это не тот ответ, который я ожидал :(


 
Defunct   (2004-02-12 05:54) [4]

можно вставить MediaPlayer, секция System
там все просто


 
Rouse_   (2004-02-12 08:39) [5]

> [3] человек в сети (12.02.04 03:23)
Хм... а какойже тогда еще ответ нужен? Такой чтоли:
sndPlaySound("1.wav", SND_ASYNC);


 
Anatoly Podgoretsky   (2004-02-12 09:43) [6]

Rouse_ © (12.02.04 01:08) [2]
Это для совместимости с Win16

человек в сети (12.02.04 00:55)
Вызвать PlaySound в обработчике OnClick



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2004.02.25;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.027 c
1-79797
ИЛЮХА
2004-02-11 11:36
2004.02.25
File


1-79768
CAHbI4
2004-02-11 21:41
2004.02.25
Содержимое DLL формы на форме вызывающего приложения


7-80325
DelphiNew
2003-12-02 11:40
2004.02.25
Проблема приёма данных с СОМ порта


9-79538
Кен
2003-08-08 02:32
2004.02.25
Кто нибудь пробовал создавать миссии для Vice City ?


7-80316
SlyFox
2003-12-05 08:17
2004.02.25
Запись CD (нужна VCL)!!!





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский