|
@@ -161,6 +161,7 @@ Since AudioStreamPlayback is controlled by the audio thread, i/o and dynamic mem
|
|
virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames);
|
|
virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames);
|
|
virtual float get_length() const; //if supported, otherwise return 0
|
|
virtual float get_length() const; //if supported, otherwise return 0
|
|
AudioStreamPlaybackMyTone();
|
|
AudioStreamPlaybackMyTone();
|
|
|
|
+ ~AudioStreamPlaybackMyTone();
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
@@ -180,6 +181,12 @@ Since AudioStreamPlayback is controlled by the audio thread, i/o and dynamic mem
|
|
zeromem(pcm_buffer, PCM_BUFFER_SIZE);
|
|
zeromem(pcm_buffer, PCM_BUFFER_SIZE);
|
|
AudioServer::get_singleton()->unlock();
|
|
AudioServer::get_singleton()->unlock();
|
|
}
|
|
}
|
|
|
|
+ AudioStreamPlaybackMyTone::~AudioStreamPlaybackMyTone() {
|
|
|
|
+ if(pcm_buffer) {
|
|
|
|
+ AudioServer::get_singleton()->audio_data_free(pcm_buffer);
|
|
|
|
+ pcm_buffer = NULL;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
void AudioStreamPlaybackMyTone::stop(){
|
|
void AudioStreamPlaybackMyTone::stop(){
|
|
active = false;
|
|
active = false;
|
|
base->reset();
|
|
base->reset();
|
|
@@ -271,6 +278,7 @@ query AudioFrames and ``get_stream_sampling_rate`` to query current mix rate.
|
|
virtual float get_length() const; //if supported, otherwise return 0
|
|
virtual float get_length() const; //if supported, otherwise return 0
|
|
virtual float get_stream_sampling_rate();
|
|
virtual float get_stream_sampling_rate();
|
|
AudioStreamPlaybackResampledMyTone();
|
|
AudioStreamPlaybackResampledMyTone();
|
|
|
|
+ ~AudioStreamPlaybackResampledMyTone();
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
@@ -289,6 +297,12 @@ query AudioFrames and ``get_stream_sampling_rate`` to query current mix rate.
|
|
zeromem(pcm_buffer, PCM_BUFFER_SIZE);
|
|
zeromem(pcm_buffer, PCM_BUFFER_SIZE);
|
|
AudioServer::get_singleton()->unlock();
|
|
AudioServer::get_singleton()->unlock();
|
|
}
|
|
}
|
|
|
|
+ AudioStreamPlaybackResampledMyTone::~AudioStreamPlaybackResampledMyTone() {
|
|
|
|
+ if (pcm_buffer) {
|
|
|
|
+ AudioServer::get_singleton()->audio_data_free(pcm_buffer);
|
|
|
|
+ pcm_buffer = NULL;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
void AudioStreamPlaybackResampledMyTone::stop(){
|
|
void AudioStreamPlaybackResampledMyTone::stop(){
|
|
active = false;
|
|
active = false;
|
|
base->reset();
|
|
base->reset();
|