You have to use a roundabout approach. Ingest the file twice, and offset the timestamps of the 2nd input by the duration at the end you wish to trim. Then pipe both streams to another ffmpeg instance with -shortest set. In the 2nd ffmpeg instance, save only the stream from the 2nd input.
ffmpeg -i in.mp3 -itsoffset 1 -i in.mp3 -map 0:a:0 -map 1:a:0 -c copy -...
You can use mediainfo to get the duration (in ms) and then cut to duration - 1:
duration=$(mediainfo FILE.mp3 --Inform="Audio;%Duration%")
ffmpeg -to $(($duration / 1000 - 1)) -i FILE.mp3 -c copy FILE_NEW.mp3
I finally have sound in my laptop!
I just made everything as module <m> under Device Drivers -> Sound Card Support -> Advanced Linux Sound Architecture and it worked!
Here is the output of lsmod for the modules that were needed:
Module Size Used by
snd_hda_codec_hdmi 45056 1
snd_hda_codec_idt 49152 1
I see, I tried converting the file myself using sox. What I got then was the following error: Playing WAVE 'CONVERTED-test.wav' : Signed 32 bit Little Endian, Rate 44100 Hz, Stereo aplay: set_params:1349: Channels count non available. Using channels 18 with the sox command then finally makes aplay play the file properly and clear! Note: When I convert the ...
In my case, the program playing it was Evolution. Here's an approach to find out what program causes it:
Install auditd (usually the audit or auditd package)
Configure a watch on the sound file by creating /etc/audit/rules.d/alarm-clock.rules with the following content:
-w /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga -p rwxa -k alarm-clock
I found this Stackexchange question trying to troubleshoot a similar issue. Although I cannot be 100% sure our issues are from the same cause I notice some similarities and hope this will help.
Specifically I see you are trying to capture a microphone and I see in your post that like I did you are using "arecord -f cd" and "arecord -f dat"...
I have the same situation. I tried some solutions with echo canceling module, they work but the quality of the sound for the receiving part is not so good. There are distortions.
Fortunately, I found a very simple solution which creates a source from another source (including any monitor), which is seen in Zoom as a normal microphone.
The following code ...
The way I got it working is that I used set mixer.alsa.device=hw:1
If you type in alsamixer, hit F6 and choose your sound card, and then F6 again "enter your device name", it should show up the right mixer setting name.
I could not comment since this is a new account but I added some code on @mreithub's answer and made it so that it cycles through audio outputs automatically.
BACKGROUND_RED="`tput setaf 1` "
$BACKGROUND_WHITE="`tput setaf 6` "
FORGROUND_BLACK="`tput setaf 0` "
DIM="`tput dim` "