Skip to content

Commit

Permalink
free record channel
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp96 committed Sep 19, 2023
1 parent 55101ef commit ff26e52
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/CSoundInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ CSoundInput::CSoundInput(int _bitRate) : encoder(new COpusEncoder(SAMPLE_RATE, A

CSoundInput::~CSoundInput()
{
if (recordChannel)
{
BASS_ChannelStop(recordChannel);
BASS_ChannelFree(recordChannel);
}
BASS_RecordFree();

std::unique_lock lock{ inputMutex };
delete encoder;
delete opusBuffer;
rnnoise_destroy(denoiser);
BASS_RecordFree();

encoder = nullptr;
opusBuffer = nullptr;
denoiser = nullptr;
}

void CSoundInput::SetVolume(float gain)
Expand Down

0 comments on commit ff26e52

Please sign in to comment.