Re: how to record sound to mp3 [wav, for those who can]

2021-03-26 Thread David Wright
On Thu 25 Mar 2021 at 23:22:35 (+0100), Nicolas George wrote:
> David Wright (12021-03-25):
> > > > $ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav
> > > This command does not record the sound being played.
> > … on your machine.
> 
> On no machine, unless specifically configured, which is not trivial at
> all.

I'm afraid it's my PCs that are making a liar of you.

> It would be helpful if people around here learned to read carefully the
> questions before trying to answer them. If they did, they would have
> noticed that the question was not to record the ambient sound but the
> sound BEING PLAYED.

What, you think that I left the speakers running so that the
microphone could record them?

Or did you think that the sound of Thursday evening traffic in
St John's Wood would carry across six timezones?

Or you think that's it's impossible that I should have been able to
record sound the computer is playing (from whatever source, external
or internal) on an OOTB PC for over twenty years?

Is that why you're shouting?

Anyway, back to talking about PCs.

> To achieve it requires either a hardware connection
> between the output and the input of the sound controller

That's my understanding. Using the terminology of the High Definition
Audio Specification (Revision 1.0a June 17, 2010), there is presumably
a link from the § 7.2.3.4 Mixer (Summing Amp) Widget output to the
§ 7.2.3.5 Selector (Multiplexer) Widget. This link in inside the
Widget Interconnection "Cloud" of Figure 49, Module-Based Codec
Architecture.

"The exact number of possible inputs to each widget is determined by
design;" (§ 7.1.1), which is why you can't just conjure up any facility
on any PC.

But the machine is no more "specifically" configured than any PC which
has HDA and a mobo: the vendor (Intel on my old one, Dell on the new)
decides how much of the architecture they will implement. And the
modern way seems to be to go cheap, particularly with consumer-grade.
OK, this one's a decent machine, but it's still a 10-yr old cast off.

Perhaps take a look at the specification and see how much is left open
to the vendor. Hence the need for scripts like alsa-info to tell you
exactly what you've bought with any given "sound card".

This PC was not cheap when it was bought, largely because it's
supposed to be fast: it was bought for students to run geophysics
programs on. You can now pick them up for just over $100. If I ever
have to hand it back, I might just do that. It'll be the first
computer I've ever bought.

> or the
> collaboration of the sound driver.

I assume by this that you're talking about pulseaudio. That's why
I've mentioned it each and every time. (This is the third—should
I put it in my signature?) I can't advise how the OP might use it,
because *I* don't¹. But perhaps that's not expected here—one just
replies   "pulseaudio"   like the people saying   "audacity"
or   "sox"   or whatever.

Finally, who's the audio expert round here? I posted what I think
is a determining factor for just vanilla ALSA and the card to work
with my command line. Presumably there's a definitive answer to
this? Do *you* have it?

¹ self-imposed simplicity: no PA, no OSS.

Cheers,
David.



Re: how to record sound to mp3 [wav, for those who can]

2021-03-26 Thread Michael Lange
On Fri, 26 Mar 2021 09:47:28 +0100
Michael Lange  wrote:

> Plus, I don't know how to switch the OSS capture
> device programmatically (if this is important for the OP's purpose).

uh, got it.

$ aumix -v R

sets "Vol" as capture device.

Regards
Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

A man either lives life as it happens to him, meets it head-on and
licks it, or he turns his back on it and starts to wither away.
-- Dr. Boyce, "The Menagerie" ("The Cage"), stardate
unknown



Re: how to record sound to mp3 [wav, for those who can]

2021-03-26 Thread Michael Lange
Hi,

On Fri, 26 Mar 2021 08:38:02 +0100
 wrote:

> On Thu, Mar 25, 2021 at 11:22:35PM +0100, Nicolas George wrote:
> > David Wright (12021-03-25):
> > > > > $ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav
> > > > This command does not record the sound being played.
> > > … on your machine.
> > 
> > On no machine, unless specifically configured, which is not trivial at
> > all.
> 
> No idea about pulse. For ALSA, there's alsaloop, which comes with a
> man page. Part of alsa-utils. No need of playing with cable loops.

another possibility: when the snd-mixer-oss module is loaded, (at least
here) when using the OSS mixer device there is a "Vol" control which
roughly appears to be the OSS equivalent to Alsa's "Master" control,
however the "Vol" control has an additional "Capture" switch. Now, when I
set "Vol" as capture device, the audio output will be used as input for
recording. Recording level can be adjusted with the "PCM" mixer control.
Of course, the presence of this "Vol" control may depend on the sound
card / driver in use.
Oddly, there seems to be no such easy way to achieve the same result with
alsamixer/amixer. Plus, I don't know how to switch the OSS capture device
programmatically (if this is important for the OP's purpose).

Regards
Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

I thought my people would grow tired of killing.  But you were right,
they see it is easier than trading.  And it has its pleasures.  I feel
it myself.  Like the hunt, but with richer rewards.
-- Apella, "A Private Little War", stardate 4211.8



Re: how to record sound to mp3 [wav, for those who can]

2021-03-26 Thread tomas
On Thu, Mar 25, 2021 at 11:22:35PM +0100, Nicolas George wrote:
> David Wright (12021-03-25):
> > > > $ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav
> > > This command does not record the sound being played.
> > … on your machine.
> 
> On no machine, unless specifically configured, which is not trivial at
> all.

No idea about pulse. For ALSA, there's alsaloop, which comes with a
man page. Part of alsa-utils. No need of playing with cable loops.

> It would be helpful if people around here learned to read carefully the
> questions before trying to answer them [...]

(I was on the verge of making a snarky comment to that, but I'll bite
my tongue).

Cheers
 - t


signature.asc
Description: Digital signature


Re: how to record sound to mp3 [wav, for those who can]

2021-03-25 Thread Linux-Fan

David Wright writes:


On Thu 25 Mar 2021 at 17:40:51 (+0100), Nicolas George wrote:
> David Wright (12021-03-25):


[...]


> > To record, you could type, for example, in another xterm:
> >
> > $ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav
>
> This command does not record the sound being played.

… on your machine. That's why I wrote "If you can't get ALSA to work…".
You're a candidate for pulseaudio, I assume.


Not sure about that command above (no means to try it just now), but _with_  
PulseAudio, I can record the sound that is being played back just fine by  
means of "monitor" audio devices. E.g. I have the following command to  
record my screen (`0:v`), the "monitor" device (`1:a`) and a microphone  
(`2:a`):


exec ffmpeg -video_size 1600x1200 -framerate 12 -f x11grab -i :0.0+0,0 -f pulse -ac 2 -i 
0 -f pulse -i 1 -c:v libvpx-vp9 -deadline realtime -b:v 2M -c:a libvorbis -map 0:v -map 
1:a -map 2:a "recording.webm"

adapted from these two sources:

-> https://trac.ffmpeg.org/wiki/Capture/Desktop
-> 
https://askubuntu.com/questions/682144/capturing-only-desktop-audio-with-ffmpeg

It may of course be true that the hardware _does_ support/accellerate this  
monitoring capability, but it does not seem to be entirely uncommon a  
feature? Here, it even works inside virtual machines :)


Btw. the existence of monitor devices can be checked in `pavucontrol` where  
under "Output" it lists two monitor devices here: One for the HDMI output  
and one for the "Built-in Analog Stereo" Output.



AFAICT, this recording facility is getting harder to find on most
computers, if you're not prepared to fork out for a sound card.
I've been fortunate, in that just as my ancient Pentium III expired,
I have acquired a Dell Precision T3500 which has a well endowed
(integrated) sound card.

I'm still finding my way round it: for example, it also has HDMI
playback, but I haven't yet worked out how to exploit it. The machine
has one DVI output and two DisplayPorts, so I need to find a
DisplayPort/HDMI adapter to see if that would yield anything.


[...]

As far as I can tell, DisplayPort can transport audio without the need for  
an HDMI adapter. Here, a Radeon Pro W5500 graphics card is connected to a  
Dell U2713HM display which has one HDMI, DP, VGA and DVI input each. The  
W5500 is connected to the DisplayPort and if I play sound to the "HDMI"  
output, the display outputs that sound through its headphones socket.


Similar to your case, there are no HDMI ports on the graphics card.
In my case, it is only DisplayPorts.

HTH
Linux-Fan

öö


pgpoa49bihnMC.pgp
Description: PGP signature


Re: how to record sound to mp3 [wav, for those who can]

2021-03-25 Thread Nicolas George
David Wright (12021-03-25):
> > > $ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav
> > This command does not record the sound being played.
> … on your machine.

On no machine, unless specifically configured, which is not trivial at
all.

It would be helpful if people around here learned to read carefully the
questions before trying to answer them. If they did, they would have
noticed that the question was not to record the ambient sound but the
sound BEING PLAYED. To achieve it requires either a hardware connection
between the output and the input of the sound controller or the
collaboration of the sound driver.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: how to record sound to mp3 [wav, for those who can]

2021-03-25 Thread David Wright
On Thu 25 Mar 2021 at 17:40:51 (+0100), Nicolas George wrote:
> David Wright (12021-03-25):
> > > now i modify my requirement to how to use arecord to record sound being 
> > > played to wav file
> 
> > To record, you could type, for example, in another xterm:
> > 
> > $ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav
> 
> This command does not record the sound being played.

… on your machine. That's why I wrote "If you can't get ALSA to work…".
You're a candidate for pulseaudio, I assume.

AFAICT, this recording facility is getting harder to find on most
computers, if you're not prepared to fork out for a sound card.
I've been fortunate, in that just as my ancient Pentium III expired,
I have acquired a Dell Precision T3500 which has a well endowed
(integrated) sound card.

I'm still finding my way round it: for example, it also has HDMI
playback, but I haven't yet worked out how to exploit it. The machine
has one DVI output and two DisplayPorts, so I need to find a
DisplayPort/HDMI adapter to see if that would yield anything.

It also has two Capture devices, and I don't know whether that means
there are two independent sound paths. If so, then I should be able to
record from the browser to one file, and from a TV (my UK one has
headphone output) or the Roku remote control to another file at the
same time.

Anyway, I just recorded a bit of audio from Abbey Road (the live webcam¹,
not the album), and printed the settings of all the controls (attached).
AIUI at present, the critical section is at the end, specifically:

Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Mic' 'Line' 'Stereo Mix'
  Item0: 'Stereo Mix'

IOW, I'm recording from the mixer.

¹ https://www.abbeyroad.com/Crossing

Cheers,
David.
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 31 [100%] [0.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 39
  Mono:
  Front Left: Playback 0 [0%] [-58.50dB] [on]
  Front Right: Playback 0 [0%] [-58.50dB] [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 0 [0%] [-46.50dB] [on]
Simple mixer control 'Line',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [on]
  Front Right: Playback 0 [0%] [-34.50dB] [on]
Simple mixer control 'Line Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Line Out',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-46.50dB] [on]
  Front Right: Playback 0 [0%] [-46.50dB] [on]
Simple mixer control 'Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Beep',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 15
  Mono: Playback 0 [0%] [-45.00dB] [off]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Speaker Only' 'Line Out+Speaker'
  Item0: 'Disabled'
Simple mixer control 'Independent HP',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 54
  Front Left: Capture 44 [81%] [7.50dB] [on]
  Front Right: Capture 44 [81%] [7.50dB] [on]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 54
  Front Left: Capture 33 [61%] [-9.00dB] [on]
  Front Right: Capture 33 [61%] [-9.00dB] [on]
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Mic' 'Line' 'Stereo Mix'
  Item0: 'Stereo Mix'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Mic' 'Line' 'Stereo Mix'
  Item0: 'Line'


Re: how to record sound to mp3

2021-03-25 Thread Celejar
On Thu, 25 Mar 2021 19:51:42 +0100
Nicolas George  wrote:

> Greg Wooledge (12021-03-25):
> > However, this is NOT something you can do with MP3 files.  They are not
> > designed to be concatenated.  (Ogg Vorbis files *are*.  MP3 files aren't.)
> 
> It's the other way around. Pure MP3 files are just a concatenation of
> self-delimited packets, concatenation will just work.
> 
> MP3 files will usually have ID3 and/or XING packets for metadata at the
> beginning or the end, concatenation will include them, and the metadata
> will be invalid, but it will not prevent the file from being played.
> 
> On the other hand, Ogg files are NOT concatenable, even those that
> contain only Vorbis audio. Some player will ignore the discontinuity at
> the concatenation points, but not all.
> 
> Also, let it be said that: decoding playing, recording and encoding
> audio files to concatenate them is a terrible idea, because it will lose
> quality both because of the decoding-encoding step and because of the
> numeric-analog-numeric step.

The FFmpeg wiki has some very useful information on concatenating media
files where a simple 'cat' won't work - I use its 'concat demuxer'
regularly to contatenate MP4 files (Android starts a new video file when
a 4GB limit is hit):

https://trac.ffmpeg.org/wiki/Concatenate

Celejar



Re: how to record sound to mp3

2021-03-25 Thread Nicolas George
Greg Wooledge (12021-03-25):
> I was told *by the developer* (Monty, in #vorbis IRC long ago) that
> Ogg Vorbis files were designed for this.

Yes, I know concatenation is supposed to be a feature, but they messed
it up.

You may not know, but the expert consensus is that, although the codec
Vorbis was excellent, and Opus even better, the design of the format Ogg
was terrible. The non-working concatenation is not the worse part. The
worse part is probably that supporting any new codec in Ogg requires
code, and non-trivial code even. Look at this:

http://git.videolan.org/gitweb.cgi/ffmpeg.git/?p=ffmpeg.git;a=blob;f=libavformat/oggparseopus.c

Compare to what it takes to support the same codec in Matroska:

http://git.videolan.org/gitweb.cgi/ffmpeg.git/?p=ffmpeg.git;a=commit;h=30549294ef0f796d48b1ffa482bd9315d4dbb83c

> However, I will note that there *are* players that don't handle
> chained Ogg Vorbis files properly.  So, make sure you test with the
> actual player you intend to use.

If concatenation really did work, it would work with all players,
because they would not even be able to detect it happened.

But it is worse than that, it is not weird players not handling the
format correctly that do not work. Concatenation works with players that
play it fast and loose with the format and fails with players that
support it completely, because they take the serial id of the streams
into account.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: how to record sound to mp3

2021-03-25 Thread Greg Wooledge
On Thu, Mar 25, 2021 at 07:51:42PM +0100, Nicolas George wrote:
> On the other hand, Ogg files are NOT concatenable, even those that
> contain only Vorbis audio. Some player will ignore the discontinuity at
> the concatenation points, but not all.

I was told *by the developer* (Monty, in #vorbis IRC long ago) that
Ogg Vorbis files were designed for this.

A few Google searches to provide supporting evidence:

https://linux.die.net/man/1/oggz-merge

  If you want to create a file containing some Ogg files sequenced one after
  another, then you should simply concatenate them together using cat. In Ogg
  this is called "chaining". If you cat Ogg Vorbis I audio files together, then
  the result will also be a compliant Ogg Vorbis file.

https://hydrogenaud.io/index.php?topic=114262.0

  Chaining in an ogg container is as simple as it gets. Just concatenate two
  separate ogg files together, the result is a chained file.


However, I will note that there *are* players that don't handle
chained Ogg Vorbis files properly.  So, make sure you test with the
actual player you intend to use.



Re: how to record sound to mp3

2021-03-25 Thread Nicolas George
Greg Wooledge (12021-03-25):
> However, this is NOT something you can do with MP3 files.  They are not
> designed to be concatenated.  (Ogg Vorbis files *are*.  MP3 files aren't.)

It's the other way around. Pure MP3 files are just a concatenation of
self-delimited packets, concatenation will just work.

MP3 files will usually have ID3 and/or XING packets for metadata at the
beginning or the end, concatenation will include them, and the metadata
will be invalid, but it will not prevent the file from being played.

On the other hand, Ogg files are NOT concatenable, even those that
contain only Vorbis audio. Some player will ignore the discontinuity at
the concatenation points, but not all.

Also, let it be said that: decoding playing, recording and encoding
audio files to concatenate them is a terrible idea, because it will lose
quality both because of the decoding-encoding step and because of the
numeric-analog-numeric step.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: how to record sound to mp3

2021-03-25 Thread Greg Wooledge
On Thu, Mar 25, 2021 at 06:29:43PM +, Long Wind wrote:
> i ask other question: which command can merge two mp3 file?this command is 
> mp3 file version of DOS command "copy file1+file2 file3"

The Unix version of that is:  cat file1 file2 > file3

However, this is NOT something you can do with MP3 files.  They are not
designed to be concatenated.  (Ogg Vorbis files *are*.  MP3 files aren't.)

I tried this:

unicorn:~$ apt-cache search concatenate mp3
poc-streamer - MP3/Ogg multicast/HTTP streamer and MP3 cutting tool

You can check that out, or try your own searches.  Or wait for other
people to respond with suggestions.



Re: how to record sound to mp3

2021-03-25 Thread ghe2001
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256



‐‐‐ Original Message ‐‐‐
On Thursday, March 25, 2021 10:40 AM, Nicolas George  wrote:

> David Wright (12021-03-25):
>
> > > now i modify my requirement to how to use arecord to record sound being 
> > > played to wav file
>
> > To record, you could type, for example, in another xterm:
> > $ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav

Have you tried Audacity?   GUI, but works good (you need to install the mp3 
library to save to mp3).

--
Glenn English
-BEGIN PGP SIGNATURE-
Version: ProtonMail

wsBzBAEBCAAGBQJgXMENACEJEJ/XhjGCrIwyFiEELKJzD0JScCVjQA2Xn9eG
MYKsjDKEdwgAl0gm+YUMCCknEjtCKj3i6iZloZtoKYwoxUEcRlxPEsbWPaDe
EA0AqwGH5kXz+hrgdcAIQmEiDq3Pc+cHOq0vLX9fAvTbwW9mSdcyGfCti5DU
awM7S8rmEj5lDTbn8veMdEr0hnM8c9mmTFEF0hmyTtYm4krnk/RXj/73zJso
a8dVHL1GvPa09xR7oQQeRcyrvCQgjvCSiu+6AygapmzWl4yHuxZcWjPciYgZ
j9uL3/Hwzxy7tZVHa9AGR9O1J09IgOdM4VghepJcDowO3KVGDYJfiryjActY
sjZ7XJ7PQbnGGxhGNpR/I23qyCGwfA2ebsfVfYcCn+u1euNNYoXFag==
=QEOi
-END PGP SIGNATURE-



Re: how to record sound to mp3

2021-03-25 Thread Nicolas George
David Wright (12021-03-25):
> > now i modify my requirement to how to use arecord to record sound being 
> > played to wav file

> To record, you could type, for example, in another xterm:
> 
> $ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav

This command does not record the sound being played.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: how to record sound to mp3

2021-03-25 Thread David Wright
On Thu 25 Mar 2021 at 12:20:56 (+), Long Wind wrote:

> now i modify my requirement to how to use arecord to record sound being 
> played to wav file

That makes it easier as there's less work for the CPU to do.

> i use buster, how to set default sound recording source?

One way is to run alsamixer in an xterm.
Help is in the top-right corner.

$ arecord -l   will give you a list of capture devices.

To record, you could type, for example, in another xterm:

$ arecord -d 10 -f cd -v -v -v -D plughw:0,0 /tmp/audiofile.wav

where 10 gives you ten seconds; 0 gives you infinite (^C to stop),
  cd gives higher quality (44100) than the default,
  dat would give you the more modern 48000,
  -v … gives a crude VU meter,
  0,0 is the bit you have to determine from   arecord -l
⮤ device
  ⮤ card (usually 0, but matters if you have, say, PCH and HDMI).

While arecord is running, you can play with the sliders for levels,
including monitoring with speakers/headphones, and changing the
capture device with .

> in early debian distro (stretch?) sound mixer can be used to set recording 
> source

Yes, I used to use aumix, but that's OSS (passé), not ALSA.

> PS: i use twm, i'm afraid that gnome recorder isn't good choice for me

If you can't get ALSA to work, you might have to use pulseaudio instead.
I believe that can overcome a card's limitations through software.

Cheers,
David.



Re: how to record sound to mp3

2021-03-25 Thread Darac Marjal

On 25/03/2021 11:37, Long Wind wrote:
> i use mplayer to play sound
> i urgently want a program that can record sound being played to mp3
> which package shall i install?

IF you're using pulseaudio as your sound server, there are some neat
solutions on the AskUbuntu site|[1]. In particular, the idea of a
"combined sink" sounds good.
|


[1]:
https://askubuntu.com/questions/60837/record-a-programs-output-with-pulseaudio


> Thanks!


OpenPGP_signature
Description: OpenPGP digital signature


Re: how to record sound to mp3

2021-03-25 Thread Victor A. Stoichita



Le 25 Mar 2021, Nicolas George  a écrit :
I am quite sure (and certain in the case of FFmpeg) that none of 
them

can record the sound being played.


If it’s about playing a file and recording its audio to mp3, the
following will work:

ffmpeg -i your-file.avi your-file.mp3

Change your-file.mp3 to your-file.wav if you prefer wav output. 
Works with any input format ffmpeg can play.


Regards,
Victor



Re: how to record sound to mp3

2021-03-25 Thread tomas
On Thu, Mar 25, 2021 at 12:20:56PM +, Long Wind wrote:
>  Thanks to all that reply!
> now i modify my requirement tohow to use arecord to record sound being played 
> to wav file
> i use buster, how to set default sound recording source?in early debian 
> distro(stretch?) sound mixer can be used to set recording source
> PS: i use twm, i'm afraid that gnome recorder isn't good choice for me

Ah -- twm. Fond memories. I upgraded to Fvwm :-)

Back on topic: I see you have a minimalistic setup. Perhaps
you need alsamixer/amixer to learn about your sources and
get the sound routing right.

Sorry, I'm a bit tight on time, otherwise I'd play a bit around
to see whether it works.

If you are playing something with mplayer, perhaps you don't need
a recording app at all -- (see mplayer's "-ao" option, for "audio
output". Something around

  mplayer ... -ao "mp3:file=foo.mp3"

might just work for you).

Cheers
 - t


signature.asc
Description: Digital signature


Re: how to record sound to mp3

2021-03-25 Thread Long Wind
 Thanks to all that reply!
now i modify my requirement tohow to use arecord to record sound being played 
to wav file
i use buster, how to set default sound recording source?in early debian 
distro(stretch?) sound mixer can be used to set recording source
PS: i use twm, i'm afraid that gnome recorder isn't good choice for me


Re: how to record sound to mp3

2021-03-25 Thread Susmita/Rajib
Please install (if not already) gnome-sound-recorder and set up
settings there itself.  You could even record on the fastest recording
option feasible for your system, and then use soundconverter to
convert the sound to mp3.
Best.



Re: how to record sound to mp3

2021-03-25 Thread Alexander V. Makartsev

On 25.03.2021 16:37, Long Wind wrote:

i use mplayer to play sound
i urgently want a program that can record sound being played to mp3
which package shall i install?
Thanks!
I recommend "audacity" sound editor. It can record audio and export to 
mp3 or other formats.


--
With kindest regards, Alexander.

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄



Re: how to record sound to mp3

2021-03-25 Thread Nicolas George
to...@tuxteam.de (12021-03-25):
> > i use mplayer to play soundi urgently want a program that can record sound 
> > being played to mp3
> 
> Command line? (from simple to complex) arecord, sox, ffmpeg 
> 
> GUI? I don't know. Perhaps snd, audacity (those are actually sound
> editors, but you can /also/ do recording)

I am quite sure (and certain in the case of FFmpeg) that none of them
can record the sound being played.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature


Re: how to record sound to mp3

2021-03-25 Thread tomas
On Thu, Mar 25, 2021 at 11:37:53AM +, Long Wind wrote:
> i use mplayer to play soundi urgently want a program that can record sound 
> being played to mp3which package shall i install?Thanks!

Command line? (from simple to complex) arecord, sox, ffmpeg 

GUI? I don't know. Perhaps snd, audacity (those are actually sound
editors, but you can /also/ do recording)

There are many, many programs in the Debian repository which can
record sound. Which one is good for you will depend a lot on your
needs and preferences.

If you have a desktop environment installed, there will be some kind
of "standard" sound handling app already there. For example, for
Gnome there is "Gnome sound recorder" (package gnome-sound-recorder).

Cheers
 - t


signature.asc
Description: Digital signature