sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Recording from Microphone
@ 2015-06-22  7:58 Eduardo Morras
       [not found] ` <7047149F7A004840A0F4FD05F4F4470123DACE0F@NDA-HCLT-MBS01.hclt.corp.hcl.in>
  0 siblings, 1 reply; 6+ messages in thread
From: Eduardo Morras @ 2015-06-22  7:58 UTC (permalink / raw
  To: sox-users


Hello, I'm starting to develop with this library.

I'm trying to use libsox in my application to record voice from microphone and process it. I have read the mans and examples*.c but found no example on how to do that, should I read from stdin? Has libsox 

I read sox.c and rec work is defined on lines 2936-2943, but don't know where the microphone is set.

The manual page for libsox(3) name the sox_open_input / sox_open_output but don't define them on head of man page.

Any clue?

Thanks

---   ---
Eduardo Morras <emorrasg@yahoo.es>

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Recording from Microphone
       [not found] ` <7047149F7A004840A0F4FD05F4F4470123DACE0F@NDA-HCLT-MBS01.hclt.corp.hcl.in>
@ 2015-06-22 10:33   ` Eduardo Morras
  2015-06-24  1:26     ` keghn
  0 siblings, 1 reply; 6+ messages in thread
From: Eduardo Morras @ 2015-06-22 10:33 UTC (permalink / raw
  To: sox-users

On Mon, 22 Jun 2015 09:40:03 +0000
"Mohita Singhal - ERS, HCL Tech" <mohita.singhal@hcl.com> wrote:

> I have used libalsa to do the recording from microphone.
> You can refer below links.
> 
> http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html
> http://www.linux.org.ru/forum/development/5473174

Yes, I know I can do it from alsa but I want to do it with sox because it abstracts me from underlayer audio system, and my app will not need install alsa if there is other audio i/o available or care to install it (with all the problems it may cause).
 
Does anyone know if "sox_open_input" and "sox_open_output" functions were renamed to "sox_open_read" and "sox_open_write"?

Thanks

> Regards
> Mohita

---   ---
Eduardo Morras <emorrasg@yahoo.es>

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Recording from Microphone
  2015-06-22 10:33   ` Eduardo Morras
@ 2015-06-24  1:26     ` keghn
  2015-06-25 10:19       ` Eduardo Morras
  0 siblings, 1 reply; 6+ messages in thread
From: keghn @ 2015-06-24  1:26 UTC (permalink / raw
  To: sox-users








http://sourceforge.net/p/sox/code/ci/master/tree/src/











--
View this message in context: http://sox.10957.n7.nabble.com/Recording-from-Microphone-tp5460p5463.html
Sent from the SoX mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Recording from Microphone
  2015-06-24  1:26     ` keghn
@ 2015-06-25 10:19       ` Eduardo Morras
  2015-06-25 22:20         ` keghn
  0 siblings, 1 reply; 6+ messages in thread
From: Eduardo Morras @ 2015-06-25 10:19 UTC (permalink / raw
  To: sox-users

On Tue, 23 Jun 2015 18:26:34 -0700 (MST)
keghn <keghn@netscape.net> wrote:
> 
> http://sourceforge.net/p/sox/code/ci/master/tree/src/
> 

Yes, I'm diving in the source code, as I said I found where the rec work begins (sox.c line 2936), then the setup of the default device (2661) and so on, but don't know where the microphone is selected or how.

I'm doing this now (borrowed from a question on stackoverflow):

sox -d -e ms-adpcm --endian little -b 8 -c 1 -r 8000 -t ul -silence 1 0.3 3% 1 0.3 3% | myapp 

My app uses libsox to process the audio piped from sox, but I want to do everything in my app, even the microphone record.

Thanks again


---   ---
Eduardo Morras <emorrasg@yahoo.es>

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Recording from Microphone
  2015-06-25 10:19       ` Eduardo Morras
@ 2015-06-25 22:20         ` keghn
  2015-06-25 22:45           ` keghn
  0 siblings, 1 reply; 6+ messages in thread
From: keghn @ 2015-06-25 22:20 UTC (permalink / raw
  To: sox-users

 
sox -b 32 -r 96000 -c 2 -t alsa hw:0,0 ./recording.wav

hw:< is your card>,<is your recording device on that card>

 In a BASH terminal type, for a list of capture devices:

arecord -l


and:

arecord -L


 In a BASH terminal type, for a list of playing devices:

aplay -l

and:

aplay -L


http://superuser.com/questions/53957/what-do-alsa-devices-like-hw0-0-mean-how-do-i-figure-out-which-to-use
http://alsa.opensrc.org/MultipleCards







--
View this message in context: http://sox.10957.n7.nabble.com/Recording-from-Microphone-tp5460p5469.html
Sent from the SoX mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Recording from Microphone
  2015-06-25 22:20         ` keghn
@ 2015-06-25 22:45           ` keghn
  0 siblings, 0 replies; 6+ messages in thread
From: keghn @ 2015-06-25 22:45 UTC (permalink / raw
  To: sox-users





http://portaudio.com/docs/v19-doxydocs/pa__devs_8c_source.html

gcc pa_devs.c -lportaudio -o pa_devs

 Just tested it, and it work on Mint Linux 64 bit OS, Mate. A Debian distro. 



--
View this message in context: http://sox.10957.n7.nabble.com/Recording-from-Microphone-tp5460p5470.html
Sent from the SoX mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-06-25 23:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-22  7:58 Recording from Microphone Eduardo Morras
     [not found] ` <7047149F7A004840A0F4FD05F4F4470123DACE0F@NDA-HCLT-MBS01.hclt.corp.hcl.in>
2015-06-22 10:33   ` Eduardo Morras
2015-06-24  1:26     ` keghn
2015-06-25 10:19       ` Eduardo Morras
2015-06-25 22:20         ` keghn
2015-06-25 22:45           ` keghn

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).