LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-12-2013, 07:37 AM   #1
ct529
LQ Newbie
 
Registered: Nov 2010
Posts: 8

Rep: Reputation: 0
Software to analyse sound and audio files (but special ones!!!!)


I want to connect to the audio "line-in" of the laptop a device that we use to listen to ultrasounds (for example bast or whales). The device takes ultrasounds and divides it by 10 hence it brings ultrasound into the audible range. When we analise the spectrogram to identify the species that is calling into the ultrasounds range, we need to multiply the frequency back by 10. In an ideal world we would like to do the recording, listen to it, see the spectrogram and record it at the same time.

I am currently using a Windows Software that does that, but it is proprietary, and I run it into a MS Window guest machine inside Virtualbox.

I would like to move to complete open source stack. I am using linux of course, 64 bit, kernel 3.8.0-27. Currently is a kubuntu installation, but I am happy to change if you know of a better distribution for my needs.

I have tried different applications (including Audacity, Sonic Visualiser and Waveform) and they are very good, but do not allow me to set a 10 multiplier for the frequency. Anyone who can help????

I need to take the line in and:
  1. record the line in at sample rate 192Khz / 32bit (the sound card supports it)
  2. listen to the sound whilst I record
  3. save it in a wav file with FREQUENCY MULTIPLIED BY 10.<- this is the most important requirement!!!!
  4. visualise the 3D sonogram real time BUT FREQUENCY MULTIPLIED BY 10.<- this is the most important requirement!!!!
  5. ideally, identify peak frequencies in a specific window and so on

I am very happy to use the command line.

Best,

Thanks!

Last edited by ct529; 08-12-2013 at 07:38 AM. Reason: It was difficult to understand, I changed the structure of one sentence
 
Old 08-12-2013, 09:46 AM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Try looking at the sox man page, perhaps the 'upsample' and 'downsample' options. It also has some visualization options.

Also try:
http://www.baudline.com/
http://code.google.com/p/spectro-edit/
 
Old 08-12-2013, 10:38 AM   #3
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Jack?

Last edited by jamison20000e; 08-14-2014 at 11:13 PM.
 
Old 08-13-2013, 09:59 AM   #4
ct529
LQ Newbie
 
Registered: Nov 2010
Posts: 8

Original Poster
Rep: Reputation: 0
First of all, thanks a lot for your answers.

I have already looked at

1) baudline which look quite promising, but I have not found a way to multiply the frequency by 10, and it seems to be unmaintained since 2010.
2) Sound Editor only takes 44100hz/16bit input, if I understand well.
3) sox does not allow for analysis of sonogram whilst listening and recording at the same time, as far as I am aware.
3) I cannot use jack at this stage because I have pulseaudio on the machine I use, and I do not think I can have both.

I was wondering whether it would be possible to at least record and listens at the same time from the command line, whilst using a software like Sonic Visualiser to actually visualise the sonogram by reading the file that is created by the command in the console.
 
Old 08-13-2013, 06:04 PM   #5
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,145
Blog Entries: 6

Rep: Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832
My 2 cents.

Quote:
we need to multiply the frequency back by 10. In an ideal world we would like to do the recording, listen to it, see the spectrogram and record it at the same time.
I'll give you some place to start. There are several ways to approach this.
An example of capturing your sound card line in. You'll need to find the correct device for your line in.
Code:
ffmpeg -f alsa -i hw:1,1 -c:a copy -vn out.wav
http://ffmpeg.org/ffmpeg.html
You can also capture your sound card with arecord.
http://linux.die.net/man/1/arecord
Also look at audacity, it will let you see what you are capturing.
http://audacity.sourceforge.net/
and sox
http://linux.die.net/man/1/sox

If you have a soundcard that won't allow capture then you will have to make a virtual loopback device.
See if your flavor of linux has snd-aloop
Add to your .asoundrc something like
Code:
pcm.!default {
  type asym
  playback.pcm "LoopAndReal"
  #capture.pcm "looprec"
  capture.pcm "hw:0,0"
}

pcm.looprec {
    type hw
    card "Loopback"
    device 1
    subdevice 0
}


pcm.LoopAndReal {
  type plug
  slave.pcm mdev
  route_policy "duplicate"
}


pcm.mdev {
  type multi
  slaves.a.pcm pcm.MixReale
  slaves.a.channels 2
  slaves.b.pcm pcm.MixLoopback
  slaves.b.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1
}


pcm.MixReale {
  type dmix
  ipc_key 1024
  slave {
    pcm "hw:0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}

pcm.MixLoopback {
  type dmix
  ipc_key 1025
  slave {
    pcm "hw:Loopback,0,0"
    rate 48000
    #rate 44100
    periods 128
    period_time 0
    period_size 1024 # must be power of 2
    buffer_size 8192
  }
}
Then
Code:
modprobe snd-aloop
Make sure that you have the mixer control for what you are trying to capture turned up.

To see the waveform of the audio while playing
Code:
ffplay -showmode 1 file.wav
In order to speed an audio file up you are going to have to compress or remove parts of it. I bet that's not what you want.
For speeding the audio up 10x try
Code:
mplayer -speed 10 file.wav
Or to slow it down
Code:
mplayer -speed .1 file.wav
I would not take an audio output, reduce it's frequency to file, then multiple the audio files frequency again.
Capture the high frequency output the way that it is. Then make a slowed copy for you to listen to.
And yes you can record and listen to a file at the same time. Either start capturing it then play the captured file with a media player, or send the capture to a named pipe, take the named pipe as an input.
 
1 members found this post helpful.
Old 08-14-2013, 05:56 AM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I have an idea. Take the program that is closest to what you want, and modify the source code a bit to get what you want.
 
Old 08-15-2013, 05:03 PM   #7
ct529
LQ Newbie
 
Registered: Nov 2010
Posts: 8

Original Poster
Rep: Reputation: 0
I am afraid I do not really have the skills to modify a piece of software as complex as Audacity ....

I aheva already tried to capture with parecord for example, but how do I listen to the file at the same time as I capture?

Concerning the input, it must be dvided by 10 .... we are listening to the ultrasound range as I was saying! Hence we need to divide by 10 to hear it, then multiply by 10 to visualise the correct frequency in the sonogram.
 
  


Reply

Tags
alsa, audacity, audio, pulseaudio, recording



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
block special and character special files s_shenbaga Linux - Newbie 4 06-23-2015 02:16 AM
LXer: 4 open source software to analyse big quantity of log files LXer Syndicated Linux News 0 12-04-2012 05:21 AM
where are core dump files and how to analyse them using gdb manish.chauhan Linux - Software 1 11-21-2007 01:59 AM
Nautilus-2.16.3 problem previewing audio files,cant set special emblems deepclutch Debian 1 02-28-2007 07:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration