Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
2
answers
104
views
Understanding the bit depth of mp3
I'm looking for expertise on mp3 audio files, specifically the mp3 format. Although I'm IT and have managed an Icecast streaming server using darkice client for many years, I inherted from a well-qualified sound engineer being the only one who knows Linux. According to Darkice, the bit sample rate i...
I'm looking for expertise on mp3 audio files, specifically the mp3 format. Although I'm IT and have managed an Icecast streaming server using darkice client for many years, I inherted from a well-qualified sound engineer being the only one who knows Linux.
According to Darkice, the bit sample rate is 44100 with a bit depth of 16, correct?
[input]
device = default #hw:1,0
sampleRate = 44100 # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample = 16 # bits per sample. try 16
channel = 2 # channels. 1 = mono, 2 = stereo
When I use soxi
to show details of a recorded audio from the stream using streamripper, I see this:
wmnfadmin@monitor:~$ soxi /nfs/Soundfiles/AV-Issues/wmnf_000000_000001_satbgs1_153.MP3
soxi WARN mp3-util: MAD lost sync
Input File : '/nfs/Soundfiles/AV-Issues/wmnf_000000_000001_satbgs1_153.MP3'
Channels : 2
Sample Rate : 44100
Precision : 16-bit
Duration : 00:53:59.89 = 142879149 samples = 242992 CDDA sectors
File Size : 38.9M
Bit Rate : 96.0k
Sample Encoding: MPEG audio (layer I, II or III)
However, if I load this same file in Adobe Audition or Audacity, it shows 32-bit float as the bit depth. Can someone help me to understand why? Our audio playback software is having issues ingesting some of this audio and we're told it is because the bit depth is 32-bit and I'm looking for ways to correct the issue.
rwfitzy
(103 rep)
Aug 10, 2024, 04:21 PM
• Last activity: Jul 23, 2025, 01:06 PM
1
votes
1
answers
56
views
How to send a "keypress" to an instance of 'mpg123' started under 'cron'?
I use `mpg123` to play a list of songs while I work. The host that actually runs `mpg123` and plays the music is a *local, headless system*, but I can connect to it over SSH. I start `mpg123` on this host in `cron`; it plays the audio tracks from my "playlist" in a continuous loop. However there are...
I use
mpg123
to play a list of songs while I work. The host that actually runs mpg123
and plays the music is a *local, headless system*, but I can connect to it over SSH. I start mpg123
on this host in cron
; it plays the audio tracks from my "playlist" in a continuous loop. However there are times when I need to pause the music (incoming phone calls, visitors, etc).
man mpg123
says that by pressing the s
key once I can pause the playing, and press it again to re-start. If I start mpg123
in a terminal, and leave it running, this works fine. I've [also learned](https://superuser.com/q/1000905/907399) that it's possible to send a "pause" signal (s
) to mpg123
when it is being played in a screen
session:
$ screen -S mpg123 # to start the screen session
$ /usr/bin/mpg123 --loop -1 /home/pi/rainstorm.mp3 # for example
'ctrl+a, d' # quit screen
...
$ screen -S mpg123 -X stuff "s" # pauses play
I found a question ***similar*** to mine [here on SO](https://stackoverflow.com/questions/18808007/sending-keystroke-to-a-process) , but the answer seems to *miss the mark* - at least I didn't understand it!
I've not been able to find a method that allows me to send a "pause" (s
) command to mpg123
if it was started under cron
. I'd prefer a *more direct* route than screen
to send this command to mpg123
, plus I'm not sure if this could even be set up using cron
.
Can someone please advise on an approach? I'd prefer a "bash
solution" to one that requires (for example) a C program - but happy to take whatever I can get!
Seamus
(3772 rep)
Mar 29, 2025, 06:21 AM
• Last activity: Mar 30, 2025, 07:12 AM
2
votes
3
answers
7533
views
How to convert .mp3 to AAC?
I am using my Nokia C2-01 which does not accept mp3s. I am thinking how to convert my mp3s to aac because it should maintain the sound quality well. Another option is to convert mp3 to m4a but I think it is not so good because m4a is mostly a container. There is a lot of discussion about the reverse...
I am using my Nokia C2-01 which does not accept mp3s.
I am thinking how to convert my mp3s to aac because it should maintain the sound quality well.
Another option is to convert mp3 to m4a but I think it is not so good because m4a is mostly a container.
There is a lot of discussion about the reverse: convert from aac/m4a to mp3 but not relevant here.
I did not find anything relevant in
apt-get
for aac
.
[Michael] I can do for one file ffmpeg -i test.mp3 test.aac
but for many files the following does not work where the command is wrying to overwrite some .mp3 files for some reason.
ffmpeg -i *.mp3 *.aac
Output for a single file with ffmpeg
---
Command ffmpeg -i test.mp3 test.aac
takes a lot of time (50 seconds for 9 MB file) and takes a lot of space (9 #0:0 (mp2 (native) -> aac (native))
Press [q] to stop, [?] for help
size= 25740kB time=00:49:26.67 bitrate= 71.1kbits/s speed=53.5x
video:0kB audio:25303kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.725856%
[aac @ 0x5619e57f44c0] Qavg: 375.695
Léo Léopold Hertz 준영
(7138 rep)
Apr 5, 2017, 05:30 PM
• Last activity: Mar 7, 2025, 11:10 PM
0
votes
0
answers
35
views
Which MP3 tagging tool for Linux? -> For Album Folders (Alrady tried a lot)
I'm trying to sort my music by album into folders. I have already tried: - Picard - easytag - puddletag - kid3 - tageditor - eartag - beets - eyeD3 I think there's an option on puddle tag but i couldn't find it, if someone could help me with that or suggest me an alternative, I'd be very happy.
I'm trying to sort my music by album into folders.
I have already tried:
- Picard
- easytag
- puddletag
- kid3
- tageditor
- eartag
- beets
- eyeD3
I think there's an option on puddle tag but i couldn't find it, if someone could help me with that or suggest me an alternative, I'd be very happy.
Dr_ Buhu
(1 rep)
Mar 1, 2025, 01:37 PM
• Last activity: Mar 2, 2025, 07:36 PM
63
votes
7
answers
81012
views
How to Extract Album Cover Image from MP3 file?
I have a bunch of MP3 files that have their album art included within the file itself. I am now looking for a way to extract them to store them separably, at best from command line. Is there a way to achieve this?
I have a bunch of MP3 files that have their album art included within the file itself. I am now looking for a way to extract them to store them separably, at best from command line.
Is there a way to achieve this?
k0pernikus
(16501 rep)
Jun 21, 2012, 02:38 PM
• Last activity: Jan 16, 2025, 02:41 AM
0
votes
1
answers
16
views
Which frame of ID3v2.3/4 use for Volumes
I have a lot of albums in mp3, for example "City: Music Cocktail", with volumes "Vol.1-Vol.5". How should I use ID3v2.3/4 tag (frames) to set this information? In `musicbrainz.org` there is a field "part of a release group series", which is set to "City: Music Cocktail" and album is set to "City: Mu...
I have a lot of albums in mp3, for example "City: Music Cocktail", with volumes "Vol.1-Vol.5". How should I use ID3v2.3/4 tag (frames) to set this information? In
musicbrainz.org
there is a field "part of a release group series", which is set to "City: Music Cocktail" and album is set to "City: Music Cocktail, Volume 1", but in ID3 there is no such field. Or there is? I'm using Navidrome to play my library.
**EDIT**
Thanks @meuh, but it confuses me with another series "Music For Cocktails" where each Volume is a double-CD pack.
Moreover, I have a Collection where each Volume have a different name and, moreover, each of 3 CDs in each volume have names.
I've found that for Subtitle of TPOS there is a TSST (Set subtitle). So, I think that TPOS and TSST are for CDs inside of each Volume. In this regard, I should put Volume name into the Album name after a comma.
Konstantin Morenko
(1570 rep)
Jan 14, 2025, 03:49 PM
• Last activity: Jan 14, 2025, 04:40 PM
4
votes
1
answers
3978
views
Is there a way to check the losslessness of a FLAC file in Linux?
Let me explain my question with greater detail: I know `FLAC` is a lossless audio format **with respect to the original file;** this is, any piece of audio encoded with `FLAC` will be preserved completely. But say I got an CD album in `MP3` format (which is, of course, lossy) and then decide to re-e...
Let me explain my question with greater detail: I know
FLAC
is a lossless audio format **with respect to the original file;** this is, any piece of audio encoded with FLAC
will be preserved completely. But say I got an CD album in MP3
format (which is, of course, lossy) and then decide to re-encode it in FLAC
and give this "lossless" version to a friend. How does he/she know that the file received from me is not an exact copy of the CD album but a camouflaged lossy copy? I've read something about it and it seems there is some app for Windows which identifies this fake FLACs
but I haven't found anything like that for Linux. So my question is: Is there a way to tell real FLACs
from fake ones in Linux?
Carl Rojas
(1139 rep)
Dec 29, 2014, 02:15 AM
• Last activity: Dec 10, 2024, 12:25 PM
5
votes
2
answers
1726
views
Tool to determine MP3 actual quality
I am looking for a CLI tool that will give me an output of the frequency range of an MP3 file, like Spek does, but without the image file. I need to this to analyse a large library of MP3 files to determine which files are not "true" 320Kbps.
I am looking for a CLI tool that will give me an output of the frequency range of an MP3 file, like Spek does, but without the image file. I need to this to analyse a large library of MP3 files to determine which files are not "true" 320Kbps.
vinushkah
(51 rep)
Aug 12, 2019, 03:07 PM
• Last activity: Nov 14, 2024, 12:45 PM
1
votes
1
answers
359
views
Is there any sort of command-line tool I can use to detect and write metadata for a song's key?
I would like to get into DJing, or at least putting songs together in series and making it work. I have already used [bpmwrap][1] to tag the tempo for every song in my library, and it immediately made me realize that even when the tempo work is done for me, it's very hard for me to match the key. Is...
I would like to get into DJing, or at least putting songs together in series and making it work. I have already used bpmwrap to tag the tempo for every song in my library, and it immediately made me realize that even when the tempo work is done for me, it's very hard for me to match the key. Is there any command-line tool for Linux that I can use to tag the key of every song in my library?
Edit: here is the text of the script that I wrote to analyze both key and tempo. You can modify it as necessary. I can clarify stuff if anyone needs it but I'm tired rn and won't do it now
#!/bin/bash
total=$(tree | grep .mp3 | wc -l)
declare -i count=0
echo -ne "Analyzing tempos... unknown/$total \r"
/home/spyndling/bigboy4tb/compiling/bpmwrap/bpmwrap.sh -w "/home/spyndling/bigboy4tb/Music imports/" > /dev/null
echo -ne "\033[2K"
echo "Tempos analyzed."
for f in ./**/**/*.mp3; do
count+=1
echo -ne "Analyzing keys... $count/$total \r"
mid3v2 --TKEY "$(keyfinder-cli "$f")" "$f"
echo -ne "\033[2K"
done
echo "Keys analyzed."
Gridzbi Spudvetch
(65 rep)
Jun 25, 2024, 09:22 PM
• Last activity: Nov 5, 2024, 06:40 AM
0
votes
1
answers
2292
views
How to convert Opus audio file to mp3 with maximum quality use FFmpeg?
How to convert Opus audio file to mp3 with maximum quality use FFmpeg? Linux. Source audio file is `Opus, stereo 48 kHz, 138 kbps, Bits per sample:32` I used `ffmpeg -i audio.opus -c:a libmp3lame -q:a 0 newfile.mp3` which gave me VBR audio with an average bitrate about 273 kb/s.
How to convert Opus audio file to mp3 with maximum quality use FFmpeg? Linux.
Source audio file is `Opus, stereo 48 kHz, 138 kbps,
Bits per sample:32`
I used
ffmpeg -i audio.opus -c:a libmp3lame -q:a 0 newfile.mp3
which gave me VBR audio with an average bitrate about 273 kb/s.
minto
(575 rep)
Sep 11, 2024, 01:22 PM
• Last activity: Sep 12, 2024, 09:31 AM
0
votes
0
answers
153
views
Failing to extract image from MP3
I have MP3 files with ID3 images of type "Other". I have tried a variety of methods to extract the images, including the suggestions at https://unix.stackexchange.com/q/41287/34677 To whit: ``` $ exiftool -a -u -g1 33-Kesh_Jig.mp3 $ ffmpeg -i 33-Kesh_Jig.mp3 qwert.png $ eyeD3 --write-images=. 33-Kes...
I have MP3 files with ID3 images of type "Other". I have tried a variety of methods to extract the images, including the suggestions at https://unix.stackexchange.com/q/41287/34677 To whit:
$ exiftool -a -u -g1 33-Kesh_Jig.mp3
$ ffmpeg -i 33-Kesh_Jig.mp3 qwert.png
$ eyeD3 --write-images=. 33-Kesh_Jig.mp3
$ eyeD3 --write-images=/tmp 33-Kesh_Jig.mp3
$ eyeD3 --write-images=tmp 33-Kesh_Jig.mp3
$ ffmpeg -i 33-Kesh_Jig.mp3 -an -c:v copy file.jpg
$ ffmpeg -i 33-Kesh_Jig.mp3 -an -c:v copy file.png
$ exiftool -a -G4 "-picture*" 33-Kesh_Jig.mp3
$ exiftool -picture -b 33-Kesh_Jig.mp3 > other.png
$ eog other.png
$ most other.png
$ exiftool -W %d%f_%t%-c.%s -b -preview:all DIR
$ exiftool -W %d%f_%t%-c.%s -b -preview:all /tmp
$ exiftool -W %d%f_%t%-c.%s -b -preview:all /tmp 33-Kesh_Jig.mp3
$ most 33-Kesh_Jig_Picture.dat
(most
is simply a pager that automatically detects binary data and displays it in a hex dump format.)
Either I get no file at all, or I get a file which contains IHDR
and Adobe XMP text strngs in it. When the file is played with VLC, the image shows up correctly. So it does not appear to be corrupt.
ffprobe
has an error Unknown attached picture mimetype: , skipping.
but exiftool -a -u -g1 33-Kesh_Jig.mp3
reports:
Picture MIME Type :
Picture Type : Other
Picture Description : ‰PNG. .
Picture : (Binary data 707734 bytes, use -b option to extract)
Ubuntourist
(191 rep)
May 28, 2024, 05:41 PM
6
votes
3
answers
4566
views
Finding duplicate files with same filename AND exact same size
I have a huge songs folder with a messy structure and files duplicated in multiple folders. I need a recommendation for a tool or a script that can find and remove duplicates with simple two matches: 1. Exact same file name 2. Exact same file size In this case, `song.mp3` with 1234 bytes of file siz...
I have a huge songs folder with a messy structure and files duplicated in multiple folders.
I need a recommendation for a tool or a script that can find and remove duplicates with simple two matches:
1. Exact same file name
2. Exact same file size
In this case,
song.mp3
with 1234 bytes of file size is stored in /songs/album1
and /songs/albumz
. The tool/script should keep only one of the copies.
I have tried czkawka on Fedora, but it can search by either filename or file size, but not *both* combined together.
Electrifyings
(63 rep)
Nov 21, 2021, 04:22 AM
• Last activity: Apr 4, 2024, 01:02 PM
3
votes
5
answers
8782
views
Remove album art from MP3 files using the command line
I want to remove the album art that is embedded in a bunch of MP3s (thousands) and cannot find a command-line way to do this. I can add art via `lame` and I can add or remove pretty much any other tags with `id3tag` but I can’t find a way to do something like: ``` for file in **/*.mp3 do $file; done...
I want to remove the album art that is embedded in a bunch of MP3s (thousands) and cannot find a command-line way to do this. I can add art via
lame
and I can add or remove pretty much any other tags with id3tag
but I can’t find a way to do something like:
for file in **/*.mp3 do $file; done
Anyone know what I might put in for ``?
lbutlr
(787 rep)
Dec 30, 2020, 12:09 AM
• Last activity: Mar 7, 2024, 09:58 AM
8
votes
3
answers
19984
views
sox returns an error when I try to handle mp3 files
Hello so here is the deal, I used: $ yum install sox To install it in CentOS 6. After that I did a quick test: $ sox test.mp3 test.amr and this is what it returns: $ sox formats: no handler for file extension `mp3' I need this done with `sox` not `lame` because I will need to use it for mixing and o...
Hello so here is the deal, I used:
$ yum install sox
To install it in CentOS 6. After that I did a quick test:
$ sox test.mp3 test.amr
and this is what it returns:
$ sox formats: no handler for file extension `mp3'
I need this done with
sox
not lame
because I will need to use it for mixing and other functions not available with lame
.
cppit
(181 rep)
Nov 2, 2013, 07:56 AM
• Last activity: Feb 5, 2024, 06:52 PM
8
votes
5
answers
11902
views
Merge mp3 files
Neither `cat` nor `mp3wrap` are working for me. They merge the files, but the when playing the resulting file, the audio length information is wrong. That is, it show the length of the 1st part (the part which was the 1st file), then the length of the 2nd ... . And so on. Other alternative that migh...
Neither
cat
nor mp3wrap
are working for me. They merge the files, but the when playing the resulting file, the audio length information is wrong. That is, it show the length of the 1st part (the part which was the 1st file), then the length of the 2nd ... . And so on.
Other alternative that might work? In the past I was happy with ffmpeg
but it was deprecated.
Pierre B
(2293 rep)
Apr 26, 2016, 05:12 PM
• Last activity: Oct 24, 2023, 09:32 PM
1
votes
1
answers
402
views
linux way to convert mp3 stereo to mono?
I know how to do it in microsoft windows using Audacity to convert a mp3 audio file from stereo to mono, but it's a few mouse clicks and time consuming if you want to do many. Is there a program in Linux that provides a way such that I can batch script the commands to convert my folder of some 1000...
I know how to do it in microsoft windows using Audacity to convert a mp3 audio file from stereo to mono, but it's a few mouse clicks and time consuming if you want to do many.
Is there a program in Linux that provides a way such that I can batch script the commands to convert my folder of some 1000 mp3 files? For example :
some_sound_program.x --convert-stereo-to-mono --input file1.mp3 --output file1_mono.mp3
some_sound_program.x --convert-stereo-to-mono --input file2.mp3 --output file2_mono.mp3
{and so on}
ron
(8647 rep)
Oct 3, 2023, 08:45 PM
• Last activity: Oct 3, 2023, 09:45 PM
3
votes
2
answers
1736
views
List MP3 files and durations
So I want to show a list of MP3 files with their durations. `ffprobe` does show me the duration of a file. But its output is nasty. It puts everything into `stderr` and I have found no way to remove its "very helpful" information about how it was compiled. So if I loop it through `*.mp3`, that infor...
So I want to show a list of MP3 files with their durations.
ffprobe
does show me the duration of a file. But its output is nasty. It puts everything into stderr
and I have found no way to remove its "very helpful" information about how it was compiled.
So if I loop it through *.mp3
, that information is displayed every single time.
I could write a filter script but might there be a simpler solution?
Mikhail Ramendik
(538 rep)
Sep 8, 2018, 10:32 PM
• Last activity: Sep 27, 2023, 11:11 AM
4
votes
2
answers
2508
views
Copy FLAC tags to MP3 files?
I have a number of FLAC files that I'm converting into MP3 files with the following: flac -cd file.flac | lame ... - file.mp3 Is there a utility which will copy Vorbis (FLAC and OGG) metadata, convert it to appropriate ID3 tags, and tag an MP3 with the same tags as the FLAC file?
I have a number of FLAC files that I'm converting into MP3 files with the following:
flac -cd file.flac | lame ... - file.mp3
Is there a utility which will copy Vorbis (FLAC and OGG) metadata, convert it to appropriate ID3 tags, and tag an MP3 with the same tags as the FLAC file?
Naftuli Kay
(41346 rep)
Jan 2, 2015, 04:14 AM
• Last activity: Feb 28, 2023, 03:15 PM
2
votes
1
answers
297
views
How to tell if a MP4 has video data and then convert it to an MP3 if there is only audio data in the file
I have a mix of MP4 files some of them only have audio data while the others have video and audio data. I want to find a way to convert the ones that don't have any video data to MP3 without checking each file one by one.
I have a mix of MP4 files some of them only have audio data while the others have video and audio data. I want to find a way to convert the ones that don't have any video data to MP3 without checking each file one by one.
wesley
(23 rep)
Dec 11, 2022, 01:32 PM
• Last activity: Dec 11, 2022, 02:36 PM
3
votes
3
answers
615
views
List all mp3 files having over 320 kbps bitrate using bash
I'd like to get a list of all mp3 files with >320 bitrate. I'm not sure, how to apply the regular expression to the output of exiftool -AudioBitrate command. find . -type f -name '*.mp3' -print0 | while IFS= read -r -d '' i; do BITRATE=echo $(exiftool -AudioBitrate "$i")| grep -q '#([0-9]+) kbps#';...
I'd like to get a list of all mp3 files with >320 bitrate. I'm not sure, how to apply the regular expression to the output of exiftool -AudioBitrate command.
find . -type f -name '*.mp3' -print0 | while IFS= read -r -d '' i; do
BITRATE=echo $(exiftool -AudioBitrate "$i")| grep -q '#([0-9]+) kbps#';
if $BITRATE > 320
then echo $BITRATE "$i"
fi
done
macaque33
(43 rep)
Feb 29, 2020, 09:38 PM
• Last activity: Dec 5, 2022, 10:07 PM
Showing page 1 of 20 total questions