valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

alsamixer problem

Tue Feb 12, 2013 2:16 pm

hi, i've tried to select my microphone from terminal:

Code: Select all

sudo alsamixer
next i close settings pressing "exit"
and i've tryed to save the changes running:

Code: Select all

sudo alsactl store

but it doesn't function and alsamixer doesn't save my changes. :evil: :evil:
Please :? , can someone help me ?

User avatar
scruss
Posts: 2542
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: alsamixer problem

Tue Feb 12, 2013 2:45 pm

Do you really need to use sudo? By running it that way, you might be setting the ALSA configuration for the root user, not the regular user.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

Re: alsamixer problem

Tue Feb 12, 2013 2:47 pm

i've read in a lot of forums and blog that to save settings you have to use sudo...

Cloudcentric
Posts: 982
Joined: Fri Sep 14, 2012 9:13 am

Re: alsamixer problem

Tue Feb 12, 2013 2:55 pm

valvale97 wrote:i've read in a lot of forums and blog that to save settings you have to use sudo...
..are you using an USB Sound Card ?
I know everything about nothing"

valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

Re: alsamixer problem

Tue Feb 12, 2013 2:57 pm

no, i'm using a webcam with microphone.
Running alsamixer i can see that the sound card i recognized, but once i've selected i can't save the changes.

valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

Re: alsamixer problem

Tue Feb 12, 2013 4:38 pm

i resolved the problem.
Now when i try to record the voice with:

Code: Select all

arecord -d 5 -D plughw:1,0 test.wav
Recording WAVE 'test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
and i try to listen what i've recorded using:

Code: Select all

aplay test.wav
Playing WAVE 'test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
i've a distorted sound, what can i do to improve the sound ?

User avatar
scruss
Posts: 2542
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: alsamixer problem

Tue Feb 12, 2013 8:37 pm

valvale97 wrote:i've a distorted sound, what can i do to improve the sound ?
Try:

Code: Select all

arecord -f cd -d 5 -D plughw:1,0 test.wav
Your first attempt was 8kHz mono 8-bit, which doesn't sound great.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

mindmasta
Posts: 58
Joined: Tue Feb 12, 2013 8:29 pm

Re: alsamixer problem

Tue Feb 12, 2013 8:43 pm

It's defaulting to 8-bit, 8000hz mono, but you can make that better (at the expense of a larger wav file, of course). I'm assuming your mic is already in a good location as not to pick up muffled sound to begin with ;)

valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

Re: alsamixer problem

Tue Feb 12, 2013 8:45 pm

i've restarted the raspberry and i don't know why the sound is much better.
If i increment the Hz, will the sound improve ?
Now another question, how can i convert test.wav files to test.flac using python ?

valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

Re: alsamixer problem

Wed Feb 13, 2013 7:30 am

I've tryed this file pranavrc/audio-transcribe/blob/master/speech.py But it gives me an error about this line

Code: Select all

fileName = str(sys.argv[1])

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: alsamixer problem

Wed Feb 13, 2013 12:04 pm

Did you follow the advice given by scruss ?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

Re: alsamixer problem

Wed Feb 13, 2013 1:27 pm

Yes, But there are no differences. What about the converter wav to flac ?

valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

Re: alsamixer problem

Wed Feb 13, 2013 4:22 pm

when in i run from the terminal:

Code: Select all

python speech.py
it gives me this error:

Code: Select all

Traceback (most recent call last):
File "speech.py", line 10, in <module>
fileName = str(sys.argv[1])
IndexError: list index out of range

texy
Forum Moderator
Forum Moderator
Posts: 5160
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: alsamixer problem

Wed Feb 13, 2013 5:24 pm

Looks like you have to enter the file name of the wav file after speech.py

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

Re: alsamixer problem

Sat Mar 02, 2013 3:23 pm

i don't know why sometimes when i run:

Code: Select all

arecord -f cd -d 5 -D plughw:1,0 test.wav
it gives me:

Code: Select all

overrun!!! (at least 4.547 ms long)
do you know why ?

User avatar
scruss
Posts: 2542
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: alsamixer problem

Thu Mar 07, 2013 10:09 pm

Have you updated your system and firmware recently? That message is what you'd get all the time with older (say, June 2012) firmwares.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

valvale97
Posts: 51
Joined: Sat Feb 09, 2013 11:13 pm

Re: alsamixer problem

Sat Mar 09, 2013 9:01 pm

hi, my crashed and i've to reinstall the OS again.
When i try to roon my old script about the google api i receive this error:

Code: Select all

 python speech.py test.wav
Failed to get binary data.
Traceback (most recent call last):
  File "speech.py", line 26, in <module>
    size_of_audio = os.path.getsize(fileName)
  File "/usr/lib/python2.7/genericpath.py", line 49, in getsize
    return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: 'test.flac'
Any idea ? are 2 days that i spend all my free time to solve this problem...

User avatar
scruss
Posts: 2542
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: alsamixer problem

Sun Mar 10, 2013 9:41 pm

As I said in my PM, is the file test.flac present on the system?
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

wally
Posts: 45
Joined: Mon Aug 06, 2012 12:07 pm

Re: alsamixer problem

Tue May 28, 2013 9:28 am

Hello,

i also want my RPI listen me :)
using speech.py example from
https://github.com/pranavrc/audio-transcribe

Code: Select all

..work/audio-transcribe-master>python ./speech.py ./softkitty.wav
Unable to connect
Traceback (most recent call last):
  File "./speech.py", line 43, in <module>
    content = response.read()
NameError: name 'response' is not defined
..work/audio-transcribe-master>
unable to connect:
used path in speech.py: url = "https://www.google.com/speech-api/v1/re ... lang=en-US"

i assume the applied url is not valid anymore (?)
any ideas ?

thx wally

Return to “Beginners”