DevMaster.net Forums
[[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]]

Go Back   DevMaster.net Forums > Programming & Development > Sound and Music Programming
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 04-09-2004, 11:15 AM   #1
Hellhound
New Member
 
Join Date: Apr 2004
Posts: 1
Thumbs up

Hi,

i've implemented an avi-player for my Application. The video part works fine, now i try to play the audio stream. I've decided to play the audio with openAL but i got several problems, hope someone of u could help...

Before i try to play the audio data directly from the stream, i will test the audio playback from memory. Therefore i loading the wave datas by the following way:

Code:
// get the size if(AVIStreamRead(m_pAudioStream, 0, AVISTREAMREAD_CONVENIENT, NULL, 0, &lSize, NULL)) *return FALSE; LPBYTE pChunk = new BYTE[lSize]; if(!pChunk) return FALSE; if(AVIStreamReadFormat(m_pAudioStream, AVIStreamStart(m_pAudioStream), pChunk, &lSize)) *return FALSE; pWaveFormat = (LPWAVEFORMATEX)pChunk; m_length = AVIStreamLength(m_pAudioStream); //Member int //check Audio Compression if(pWaveFormat->wFormatTag!=1) return FALSE; *// FIX:: Audio datas copressed, decompress them // Definie Databuffers (size of one sample is 4) m_lpAudioBuffer = new BYTE[m_length*4]; if(!m_lpAudioBuffer) return FALSE; // Get the full stream for(int i=0; i<m_length; i++){ // Auslesen der Audiodaten in den Datenpuffer if(AVIStreamRead(m_pAudioStream, 0, AVISTREAMREAD_CONVENIENT, &m_lpAudioBuffer[i], lSize, NULL, NULL)) * return FALSE; }

To Play the data i try to use the alBufferData-Method by the following way:
Code:
alBufferData(buffer, AL_FORMAT_STEREO16, m_lpAudioBuffer, m_length*4, pWaveFormat->nSamplesPerSec);

I got no compiler or linker failures and the method call works, but when i call
alSourcePlay i hear nothing (volume 20.0f) ...

Can anyone tell me what i've made wrong? Or knows a tutorial or a solution how
i can handle this problem?

Thx in advance,
Christian
Hellhound is offline   Reply With Quote
Old 09-03-2004, 08:25 AM   #2
kitt3n
New Member
 
Join Date: Sep 2004
Posts: 15
Default

Does playing wav's work (just loading from harddisk)?

Just a guess (I'm by no way an expert) - is the wav compressed
as adpcm?
I couldn't play these when I started playing around with openAL,
so I just converted them to standard wav's.

btw... isn't the max for volume 1.0f?

Regards,
Roger
kitt3n is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -7. The time now is 03:35 AM.


Powered by vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.