Slighty
Posts: 32
Joined: Thu Dec 15, 2016 7:40 pm

Audacity/Microphone - Raspberry Pi 3.

Mon Jun 17, 2019 9:48 am

** Forgive me there seems similar posts but none with resolution ***

So I have 20 Raspberry Pi that i use with kids for mostly Programming and STEM learning.

I am running a summer camp in mid July and want to teach kids to record e.Books/Podcasts - I am a huge fan of Audacity and will use this as some will bring Laptops with this installed.

I have it installed on the Pi, and I can import/export - BUT Microphone through the Headphone connector understandable doesn't work (ie doesnt record audio).

SOME homework on here seems to suggest an USB Microphone could be a solution (however as i say with no confirmed resolution) before i lay out funds for USB microphones does this work and do a need FURTHER hardware to add this functionality (such as sound cards etc) or change config file ?

I dont mind recording via a 3rd party and importing into Audacity - but i just need a medium to records (easily-ish)

Thanks in advance

tvjon
Posts: 704
Joined: Mon Jan 07, 2013 9:11 am

Re: Audacity/Microphone - Raspberry Pi 3.

Mon Jun 17, 2019 10:58 am

"So I have 20 Raspberry Pi that i use with kids for mostly Programming and STEM learning.

I am running a summer camp in mid July and want to teach kids to record..."


Sounds good!


I would think about future projects with the children, & instead buy (now) cheap Sony PS3 usb webcams, & for your current project just use the good quality internal microphone array, ignoring the video output. Later you could use the video too :)

No sound cards or any other hardware required.

ISTR I posted a linux command line (or URL to) for recording good quality sound to either .wav, or mp3.

If I get time today, I'll see if I can find my relevant post.

Good luck with your project.

Slighty
Posts: 32
Joined: Thu Dec 15, 2016 7:40 pm

Re: Audacity/Microphone - Raspberry Pi 3.

Mon Jun 17, 2019 11:25 am

Hey TVJon

Thanks for the reply - you telling me that PS3 webcam (as used for PS Eyetoy/pet ) will work?

If that is the case that is epic mate and that is an proper good investment - i know i was looking at buying some Pi cameras so kids could build and code a security system that emails photos on detection - the PS3 camera (might) be able to do similar.

Great shout , please do try and find your post meanwhile i will dig out my old PS3 camera (i have one upstairs i am sure)

Cheers again

tvjon
Posts: 704
Joined: Mon Jan 07, 2013 9:11 am

Re: Audacity/Microphone - Raspberry Pi 3.

Mon Jun 17, 2019 12:42 pm

Slighty wrote:
Mon Jun 17, 2019 11:25 am
...t is an proper good investment - i know i was looking at buying some Pi cameras so kids could build and code a security system that emails photos on detection - the PS3 camera (might) be able to do similar.
...

Well, that's the point really. Some of the folk I encounter don't have 2 (half) pennies to rub together, so can only dream of some of the setups talked about sometimes on the forum.

The webcams perform 2 useful functions on all existing RPi's, so handy for education etc..

Attached is a pic' of the camera I'm using.



Ok, if you want mp3's, eg.:

$ arecord -D plughw:1,0 -f dat | lame --preset 56 - `date +%Y%m%d%H%M`.mp3

If you don't have

lame

on your µSD cards,

$ sudo apt install lame

Reading package lists... Done
Building dependency tree
Reading state information... Done
lame is already the newest version (3.99.5+repack1-9).

I already have, hence the message above.

In case you'd like the children to use .wav's, try:

$ arecord -D plughw:1,0 -f dat > goodQualityButBIGfiles.wav

To simply play files back (of course Audacity will open them too) try:

$ omxplayer -o alsa 201906171306.mp3

or

$ omxplayer -o alsa file.wav

This assumes the audio jack for output rather than HDMI

Whilst writing this reply on this RPi3b, a webcam is all that's plugged in, hence the

plughw:1,0

If that isn't right for your setup, try:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: CameraB409241 [USB Camera-B4.09.24.1], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

to get the correct numbers for your usb camera.

I hope you all enjoy your summer camp.
Attachments
ps3cam.jpg
ps3cam.jpg (4.65 KiB) Viewed 553 times

Slighty
Posts: 32
Joined: Thu Dec 15, 2016 7:40 pm

Re: Audacity/Microphone - Raspberry Pi 3.

Sun Jun 23, 2019 10:21 am

Hey @
tvjon

So sorry to get back to you slowly, Its been manic here just getting round to to your advice.

So I plugged in the PS3 webcam (via USB) installed LAME as per instruction - it seemed to unpack and build dependency trees.

Yet on record button (Audacity) it still gives the original error message.

Please forgive my lack of knowledge/ignorance with the LINUX set up as you were good enough to give me further script. Do i need to install / run something else or configure this camera/microphone to be detected in a config?

Again sorry for the hassle but i am loving your suggestion so keen to get it working.

Thank you again

Tim

Slighty
Posts: 32
Joined: Thu Dec 15, 2016 7:40 pm

Re: Audacity/Microphone - Raspberry Pi 3.

Sun Jun 23, 2019 11:29 am

TVJon

Scrub that i got 'something' working... thanks mate ace.

I used

$ arecord -D plughw:1,0 -f dat > goodQualityButBIGfiles.wav

To record via the PS3 mic - GREAT recording actually there was family and radio in the background and it didnt pick that up !! ace...

2 quick questions (sorry)

A) How do i 'stop' recording via this script ? - i had to close the terminal window Ctrl/X or esc didnt appear to close off the recording request.
B) Is there any way to record direct via Audacity (ie detect the PS3 camera and slect as device) as suggested here http://wiki.sunfounder.cc/index.php?tit ... n_Raspbian

I tried to follow the instructions alas the PS3 was never shown under recording devices.

The only reasons i ask is that some of my students are 8-11 and the typing of script etc might be a touch advanced for some of them . A simple click on the 'record' button would make both our days easier ;0)

Thank you again for your help... you have been ace !!

tvjon
Posts: 704
Joined: Mon Jan 07, 2013 9:11 am

Re: Audacity/Microphone - Raspberry Pi 3.

Mon Jun 24, 2019 10:30 am

"So sorry to get back to you slowly, Its been manic here just getting round to to your advice."

Not to worry. I'm busy too :)

Ctrl c to stop recording via the console command line.

I only have experience of audacity on Rpi's. I have no wintel kit, only RPi's & iOS.

As you can see from the attached screenshot, audacity is recording fine with the ps3cam.

You need to set its audio output to RPi's internal audio, so "default" as seen in the open pref's window on the screenshot.

The mp3 command I posted was in case any of the children left a recording running - using wav would fill up the µSD card quite quickly, but you can record for hours using mp3. Also individual students might perhaps want to demonstrate their recordings to parents, so mp3 would be fine, wav a tad unwieldy.


"some of my students are 8-11 and the typing of script etc might be a touch advanced for some of them . A simple click on the 'record' button would make both our days easier ;0)"

What are you intending to use audacity for during your lessons? I'd have thought everything on each RPi would be easier logistically, rather than laptops too?

If it's only to record, command line is definitely simpler.

The $ prefixed lines I posted are commands, not really scripts. However you can put a command into a script, so your students just type, say a 3 letter command word which runs one of the commands.

Make a directory in your µSD card's home directory, called

bin

Write a new file saved to bin, eg. call it mp3 (almost any name you like really)

In that file paste the command line:

arecord -D plughw:1,0 -f dat | lame --preset 56 - `date +%Y%m%d%H%M`.mp3

Next right click on that new file, select

Properties

& click on the Permissions tab

then in the

Execute

field, left click

Only owner; ok

Now, when a student wants to record a mp3 file,

open a console (terminal) window, type

mp3

& a recording will proceed.

Ctrl c to stop it.

HTH
Attachments
audacity-ps3cam.jpg
audacity-ps3cam.jpg (113.04 KiB) Viewed 380 times

Slighty
Posts: 32
Joined: Thu Dec 15, 2016 7:40 pm

Re: Audacity/Microphone - Raspberry Pi 3.

Mon Jun 24, 2019 10:54 am

Mate a proper sound reply (no pun intended) thank you !!

I will be using audacity to create an e.Book - so they will import sounds (doors opening, farm yard noises etc) as needed (down load from Findsounds) but i would want them to record their voice telling/narrating the story - then add effects etc to create a sense of appropriate atmosphere

I will have a play with the script - as you say it is simple enough - some are bringing laptops to the camp so i would rather the kids have a consistent method to record - ie just pressing record button.

I will select this in the preferences as instructed = BTW i ordered 4 PS3 webcams on Amazon for £6.99 each - dont you love depreciation ;0)

Thanks again mate ... brilliant support and really grateful of your time

Tim

Slighty
Posts: 32
Joined: Thu Dec 15, 2016 7:40 pm

Audacity/Microphone - Raspberry Pi 3.- SOLVED

Mon Jun 24, 2019 6:43 pm

Just to say I did as you said and WHALLA.

Audacity records via the Record button.

Mate I am so grateful and thankful of your time and guidance. As you said some on here have enviable kit and a knowledge base to go ... and assume others also.

So it was great to get both realistic and salient support .

I really owe you thank you.

...now must get off n order them cameras ;0)

Return to “Graphics, sound and multimedia”