User Tools

Site Tools


en:tutorials:audio:sound-recording

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:orx:tutorials:community:tdomhan:sound-recording [2011/01/11 19:08 (13 years ago)] – Updated info to match the version integrated to the trunk iarwainen:tutorials:audio:sound-recording [2022/03/27 13:42 (2 years ago)] (current) – Removed OpenAL reference iarwain
Line 5: Line 5:
 http://orx.svn.sourceforge.net/viewvc/orx/trunk/ http://orx.svn.sourceforge.net/viewvc/orx/trunk/
  
-Furthermore sound capturing is only implemented in the OpenAL sound plugin right now. We will now present some basic recipes for common tasks and then cover the advanced settings and the whole API later.+We will now present some basic recipes for common tasks and then cover the advanced settings and the whole API later.
  
 ===== Capturing audio data to a file ===== ===== Capturing audio data to a file =====
Line 23: Line 23:
 You can decide if you want to write the recorded data to the file with _bWriteToFile = orxTRUE/orxFALSE. We'll see later how to decide this on a per packet basis. You can decide if you want to write the recorded data to the file with _bWriteToFile = orxTRUE/orxFALSE. We'll see later how to decide this on a per packet basis.
  
-Passing 0 to _u32SampleRate and/or _u32ChannelNumber will use orx's default values for them. Defaults values are 44100Hz for the sampling rate and mono for the chanel number.+Passing 0 to _u32SampleRate and/or _u32ChannelNumber will use orx's default values for them. Defaults values are 44100Hz for the sampling rate and mono for the channel number.
  
 Once you think you have captured enough data you can stop recording like this: Once you think you have captured enough data you can stop recording like this:
Line 74: Line 74:
 <code c> <code c>
   //now let's start recording:   //now let's start recording:
-  orxSound_StartRecording("sound.wav", 0, 0);+  orxSound_StartRecording("sound.wav", orxFALSE, 0, 0);
 </code> </code>
 Afterwards, the first event our handler will receive has a orxSOUND_EVENT_RECORDING_START ID. After that, each time new audio data is available, an event of orxSOUND_EVENT_RECORDING_PACKET ID will be created. You can access the raw audio data through the payload of the event. Beside the audio data it also contains the number of samples that were captured and the time at which the current samples were recorded(in seconds since starting the application). More precisely it's the timestamp of the first sample in the current package. Each audio sample is represented by a 16bit integer value, ranging from -32768 to 32767, 0 being an audio output level of zero. Afterwards, the first event our handler will receive has a orxSOUND_EVENT_RECORDING_START ID. After that, each time new audio data is available, an event of orxSOUND_EVENT_RECORDING_PACKET ID will be created. You can access the raw audio data through the payload of the event. Beside the audio data it also contains the number of samples that were captured and the time at which the current samples were recorded(in seconds since starting the application). More precisely it's the timestamp of the first sample in the current package. Each audio sample is represented by a 16bit integer value, ranging from -32768 to 32767, 0 being an audio output level of zero.
Line 165: Line 165:
  
 </code> </code>
- 
en/tutorials/audio/sound-recording.1294801708.txt.gz · Last modified: 2017/05/30 00:50 (7 years ago) (external edit)