Skip to content

Commit

Permalink
Merge pull request #1 from fbrand-new/feat/recorder_nws
Browse files Browse the repository at this point in the history
AudioRecorder_nws and backupVAD fix
  • Loading branch information
colombraf authored Oct 12, 2023
2 parents 0d2ba11 + 4bd008e commit 51104bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions app/r1Obr-orchestrator/scripts/R1_Orchestrator_YOLO.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
<!-- audio recorder -->
<module>
<name>yarprobotinterface</name>
<parameters>--context vadModule --from audioRecorderAutoStart.ini</parameters>
<parameters>--context whisperTranscribe_demo --config yarp_audioFromMic.xml</parameters>
<node>r1-torso</node>
</module>

<!-- VAD -->
<module>
<name>backupVAD</name>
<parameters></parameters>
<node>r1-torso</node>
<node>console</node>
</module>

<!-- Whisper: speech transcription -->
<module>
<name>yarprobotinterface</name>
<parameters>--context whisperTranscribe_demo --config yarp_transcribe.xml --model ggml-base.en.bin </parameters>
<parameters>--context whisperTranscribe_demo --config yarp_transcribe.xml --model ggml-small3.it.bin </parameters>
<node>pc</node>
</module>

Expand Down Expand Up @@ -100,7 +100,7 @@
<!-- -->

<connection>
<from>/audioRecorderWrapper/audio:o</from>
<from>/audioRecorder_nws/audio:o</from>
<to>/vad/audio:i</to>
<protocol>fast_tcp+recv.portmonitor+file.soundfilter_resample+type.dll+channel.0+frequency.16000</protocol>
</connection>
Expand Down Expand Up @@ -137,13 +137,13 @@

<connection>
<from>/r1Obr-orchestrator/chatBot/microphone:rpc</from>
<to>/audioRecorderWrapper/rpc</to>
<to>/audioRecorder_nws/rpc</to>
<protocol>fast_tcp</protocol>
</connection>

<connection>
<from>/r1Obr-orchestrator/microphone:rpc</from>
<to>/audioRecorderWrapper/rpc</to>
<to>/audioRecorder_nws/rpc</to>
<protocol>fast_tcp</protocol>
</connection>

Expand Down
12 changes: 6 additions & 6 deletions modules/backupVAD/AudioProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void AudioProcessor::processAudio(yarp::sig::Sound& inputSound){
yCError(VADAUDIOPROCESSOR) << "The frequency needs to be at least" << m_vadFrequency;
}
double sampleSecondsLength = (double) inputSound.getSamples() / inputSound.getFrequency();
if (int(sampleSecondsLength*1000) % m_vadSampleLength == 0 ) {
// if (int(sampleSecondsLength*1000) % m_vadSampleLength == 0 ) {
// if (m_microphoneOpen) {

int numberOfSamplesPerPacket = m_vadSampleLength * (m_vadFrequency / 1000);
Expand All @@ -124,11 +124,11 @@ void AudioProcessor::processAudio(yarp::sig::Sound& inputSound){

processPacket(copiedSound);
// }
// }
}
} else {
yCDebug(VADAUDIOPROCESSOR) << "cannot split samples into packets.";
}
}
// }
// } else {
// yCDebug(VADAUDIOPROCESSOR) << "cannot split samples into packets.";
// }
m_soundToProcess.pop_front();
}

Expand Down

0 comments on commit 51104bb

Please sign in to comment.