Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

acmStreamOpen() always fails!

Status
Not open for further replies.

Oyl

Programmer
Joined
Apr 8, 2000
Messages
2
Location
DE
Tried to convert ADPCM / MP3 waves to standard PCM waves (to be able to use compressed waves in DirectSound<br>(IDirectSoundBuffer). btw, how can I fill those 2 pointers of sound data with ACM?). But even this simple example with source and destination format being standard PCM fails when opening the stream.<br>But &quot;ACMapp&quot; works just fine (with all formats). But I really don't know where my mistake is.<br><br>Sample code:<br><FONT FACE=monospace><br>// source format -- 44.1 Hz, 16 bit, mono<br>WAVEFORMATEX s;<br>s.cbSize = 0;<br>s.nAvgBytesPerSec = 88200;<br>s.nBlockAlign = 2;<br>s.nChannels = 2;<br>s.nSamplesPerSec = 44100;<br>s.wBitsPerSample = 16;<br>s.wFormatTag = WAVE_FORMAT_PCM;<br><br>// destination format<br>WAVEFORMATEX d;<br>d = s;<br>d.nChannels = 1; // not really needed<br><br>HACMSTREAM stream;<br>// always &quot;not possible&quot;! Why???<br>acmStreamOpen(&stream, NULL, &s, &d, NULL, 0, 0, ACM_STREAMOPENF_NONREALTIME);<br>// ...<br></font><br>HELP!<br>--Leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top