![]() ![]() applications need to handle audio format and sample rate conversion.only one application can play sound at one time.How about interacting with device drivers directly? Win MM Application DirectSound Application WinMM.DLL DSound.DLL User Mode Kernel Mode SysAudio.SYS Kmixer.SYS Device Drive Container Windows Components By Hardware Vendor ISA CARD Driver PCI CARD Driver USB Device Driver IEEE 1394 Device Driver.kernel mixing is not necessary if I’m the only application generating audio streams.kernel mixing introduces at least 30 ms of delay.Streaming audio in an event-driven thread while (true) // while.set the notification positions during playback, whenever the play cursor reaches one of the specified offsets, the associated event is signaled.SetNotificationPositions(NumberOfNotifyStructure, ArrayofNotifyStructure).cause the sound buffer to play, starting from the play cursor.ready all or part of the buffer for a data write and return pointers to which data can be written.Lock(offset, size, addr1, size1, addr2, size2, flag).SetCooperativeLevel(windowHandle, level).audio format: commonly16 bits linear PCM.create a sound buffer object to manage audio samples.CreateSoundBuffer(descriptor, bufferPointer, …).buffer notifications: send events when buffer cursors reach a position.buffer cursors: point to current captured/played audio data.secondary buffers: write/read audio data.Not very interesting to real-time applications.need to use callback or polling to check the result.waveOutClose(…) - close the output audio device.waveOutWrite(…) - write the waveform audio data.waveOutOpen(…) - open the output audio device.no easy way to implement features, e.g.inability to take advantage of hardware acceleration.Kmixer.SYS performs the actual converting Win MM Application DirectSound Application WinMM.DLL DSound.DLL User Mode Kernel Mode SysAudio.SYS Kmixer.SYS Device Drive Container Windows Components By Hardware Vendor ISA CARD Driver PCI CARD Driver USB Device Driver IEEE 1394 Device Driver.SysAudio.SYS decides the optimal audio format and sample rate conversion.multiple audio streams can be played at the same time.a single audio driver works for multiple Windows versions.supported by Win 98, Win ME, Win 2K and Win XP. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |