-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mic and speaker update #70
Conversation
…enchantments for mp3 file playing
snd_pcm_set_params(alsaHandle, SND_PCM_FORMAT_S16_LE, SND_PCM_ACCESS_RW_INTERLEAVED, 1, rate * channels, 2, 50000); | ||
|
||
|
||
snd_pcm_set_params(alsaHandle, SND_PCM_FORMAT_S16_LE, SND_PCM_ACCESS_RW_INTERLEAVED, channels, rate, 2, 50000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this cause issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue was bit further down the code in:
if(snd_pcm_writei(alsaHandle, buffer, buffer_size/2 < 0) where I was sending too big chunk of a buffer. To compensate for that I only let alsa run in 1 channel. I further divided buffer into individual bytes when sending to device and now it runs without issues in both stereo and mono files.
Other than the comment, LGTM, formatting needs to be fixed. |
@Serafadam I further added low pass filter to mic node to remove (most of the) noise from recording. You can check out that change and if everything looks ok, you can merge. |
Adds ability to stop recording via service call (timeout of 30 seconds otherwise).
Adds ability for speaker node to play wav files.
Changes "mp3_file" request variable from PlayAudio service call as it no longer makes sense (as it can both play wav and mp3), updates lifecycle manager and rae_sdk to account for that.
Adding gain to wav file playing to account for bit quieter recording.
Update for pcm params for mp3 playing to use relevant channels better.
Added a dead zone for motors to not confuse PID controller on low speeds. Should solve RAE moving when command to stop is given.