[Solved]To grab the output from a code to a wave file?

If none of the more specific forums is the right place to ask

[Solved]To grab the output from a code to a wave file?

Postby bkpsusmitaa » 2018-08-04 11:15

Within this present thread itself, I sent my original post to my immediately next post below it.

I had to do this because the BB-code doesn't allow the Subject/Thread Title to be changed independently of the first post on that thread.

The independence is required because the solution is likely at the bottom of any thread, not at the top.

The solution to this query is at the last post within this thread.
Last edited by bkpsusmitaa on 2018-09-08 07:58, edited 4 times in total.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home
bkpsusmitaa
 
Posts: 368
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

The man file appears to be too cryptic to comprehend

Postby bkpsusmitaa » 2018-08-04 16:38

Hello, friends.
Open a terminal. Copy-paste the code:
Code: Select all
nohup play -n synth brownnoise synth pinknoise mix synth sine amod 0.3 20

I may use multiple terminals, all playing the same sound at a mutual time-lapse with each other.
I want to grab the output audio using a terminal to a wave file.
How can I do it?
Can be done with using Sox's "rec" utility:
Code: Select all
rec -c 2  myFile.mp3

Very good noise quality for sleeping and relaxing.

Question is: How to combine the two codes for an output file with the combined sounds in myFile.mp3?

The following special filenames may be used in certain circumstances in place of a normal filename on the command line:
-

SoX can be used in simple pipeline operations by using the special filename '-' which, if used in place of an input filename, will cause SoX will read audio data from 'standard input' (stdin), and which, if used in place of the output filename, will cause SoX will send audio data to 'standard output' (stdout). Note that when using this option, the file-type (see -t below) must also be given.
"|program [options] ..."
This can be used in place of an input filename to specify the the given program's standard output (stdout) be used as an input file. Unlike - (above), this can be used for several inputs to one SoX command. For example, if 'genw' generates mono WAV formatted signals to its standard output, then the following command makes a stereo file from two generated signals:

Code: Select all
    sox -M -t wav "|genw --imd -" -t wav "|genw --thd -" out.wav


If -t is not given then the signal is assumed (and checked) to be in SoX's native .sox format (see -p below and soxformat(7)).


But can't make head or tail of either genw, imd or thd. And like man pages are cryptic, this one is also cryptic.
Last edited by bkpsusmitaa on 2018-09-08 07:51, edited 3 times in total.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home
bkpsusmitaa
 
Posts: 368
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

Re: To grab the output from a code to a wave file?

Postby bkpsusmitaa » 2018-08-04 16:56

Why is my default input being shown as pulseaudio? Why not stdin?
Code: Select all
rec -c 2 myFile.mp3


Input File : 'default' (pulseaudio)
Channels : 2
Sample Rate : 48000
Precision : 16-bit
Sample Encoding: 16-bit Signed Integer PCM
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home
bkpsusmitaa
 
Posts: 368
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore

Re: To grab the output from a code to a wave file?

Postby bkpsusmitaa » 2018-09-07 10:09

The solution for recording is the same as that collected in the thread: [Solved]Full Duplex sound playback recording config?
Last edited by bkpsusmitaa on 2018-09-08 09:47, edited 1 time in total.
Freedom is impossible to conceive.
Books that help:
Dale Carnegie's How To Win Friends And Influence People and Emilie Post's Etiquette In Society, In Business, In Politics, And At Home
bkpsusmitaa
 
Posts: 368
Joined: 2009-07-04 06:32
Location: Home: Barrackpore and Mysore


Return to General Questions

Who is online

Users browsing this forum: Zjho and 6 guests

fashionable