-
Wave audio data blocks
Hi All,
Is there a way of calculating an optimum size of the audio data blocks
allocated for playing waveform audio, based on the waveforms characteristics
(format, bits/sample, sample rate). In the following call:
waveOutWrite( m_hWaveOut, m_pWaveHdr[m_nBufIndex], sizeof(WAVEHDR) )...
this would be the "m_pWaveHdr" parameter.
Regards,
Vinay
-
Re: Wave audio data blocks
Vinay,
The audio data can be created in blocks. For example to hold an
audio data for one sec you can use the following formula
RECORD_SIZE SAMPLING_FREQ * TIME_TO_RECORD *
BYTES_PER_SAMPLE*NUMBER_OF_CHANNELS
Here the best practice is to set up the buffer for 1sec of audio
data ie by setting TIME_TO_RECORD = 1 and implement a circular
buffer technique with wave call back to play the audio data.So
each buffer will be capable of holding 1sec of data.
I hope this helps
Vibin
"Vinay Kapoor" <vinay_kapoor@yahoo.com> wrote:
>Hi All,
>
>Is there a way of calculating an optimum size of the audio data blocks
>allocated for playing waveform audio, based on the waveforms characteristics
>(format, bits/sample, sample rate). In the following call:
>
>waveOutWrite( m_hWaveOut, m_pWaveHdr[m_nBufIndex], sizeof(WAVEHDR) )...
>
>this would be the "m_pWaveHdr" parameter.
>
>Regards,
>Vinay
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks