RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
ik_IAudioRecorder.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2008 Nikolaus Gebhardt
2 // This file is part of the "irrKlang" library.
3 // For conditions of distribution and use, see copyright notice in irrKlang.h
4 
5 #ifndef __I_IRRKLANG_AUDIO_RECORDER_H_INCLUDED__
6 #define __I_IRRKLANG_AUDIO_RECORDER_H_INCLUDED__
7 
8 #include "ik_IRefCounted.h"
9 #include "ik_ISoundSource.h"
10 
11 
12 namespace irrklang
13 {
14  class ICapturedAudioDataReceiver;
15 
17 
19  class IAudioRecorder : public virtual IRefCounted
20  {
21  public:
22 
24 
34  virtual bool startRecordingBufferedAudio(ik_s32 sampleRate=22000,
35  ESampleFormat sampleFormat=ESF_S16,
36  ik_s32 channelCount=1) = 0;
37 
39 
51  ik_s32 sampleRate=22000,
52  ESampleFormat sampleFormat=ESF_S16,
53  ik_s32 channelCount=1) = 0;
54 
56  virtual void stopRecordingAudio() = 0;
57 
59 
64  virtual ISoundSource* addSoundSourceFromRecordedAudio(const char* soundName) = 0;
65 
67 
68  virtual void clearRecordedAudioDataBuffer() = 0;
69 
71  virtual bool isRecording() = 0;
72 
74 
75  virtual SAudioStreamFormat getAudioFormat() = 0;
76 
78 
84  virtual void* getRecordedAudioData() = 0;
85 
87 
89  virtual const char* getDriverName() = 0;
90  };
91 
92 
94 
96  {
97  public:
98 
100 
103  virtual void OnReceiveAudioDataStreamChunk(unsigned char* audioData, unsigned long lengthInBytes) = 0;
104  };
105 
106 
107 } // end namespace irrklang
108 
109 
110 #endif
structure describing an audio stream format with helper functions
virtual SAudioStreamFormat getAudioFormat()=0
Returns the audio format of the recorded audio data.
Interface to be implemented by the user if access to the recorded audio data is needed.
Base class of most objects of the irrKlang.
virtual void OnReceiveAudioDataStreamChunk(unsigned char *audioData, unsigned long lengthInBytes)=0
Gets called once for each captured audio data chunk.
signed int ik_s32
32 bit signed variable.
virtual void clearRecordedAudioDataBuffer()=0
Clears recorded audio data buffer, freeing memory.
Everything in the irrKlang Sound Engine can be found in this namespace.
A sound source describes an input file (.ogg, .mp3, .wav or similar) and its default settings...
virtual const char * getDriverName()=0
returns the name of the sound driver, like 'ALSA' for the alsa device.
virtual bool isRecording()=0
Returns if the recorder is currently recording audio.
virtual ISoundSource * addSoundSourceFromRecordedAudio(const char *soundName)=0
Creates a sound source for the recorded audio data.
virtual bool startRecordingBufferedAudio(ik_s32 sampleRate=22000, ESampleFormat sampleFormat=ESF_S16, ik_s32 channelCount=1)=0
Starts recording audio.
16 bit, signed (-32k;32k)
virtual void stopRecordingAudio()=0
Stops recording audio.
ESampleFormat
audio sample data format enumeration for supported formats
virtual void * getRecordedAudioData()=0
Returns a pointer to the recorded audio data.
Interface to an audio recorder. Create it using the createIrrKlangAudioRecorder() function...
virtual bool startRecordingCustomHandledAudio(ICapturedAudioDataReceiver *receiver, ik_s32 sampleRate=22000, ESampleFormat sampleFormat=ESF_S16, ik_s32 channelCount=1)=0
Starts recording audio.