Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Multimedia
  • Search

Recommend a sox writable format for my needs.

Help with creation, editing, or playback of sounds, images, or video. Amarok, audacious, mplayer, grip, cdparanoia and anything else that makes a sound or plays a video.
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
Skotlex
Guru
Guru
Posts: 318
Joined: Sat Mar 13, 2004 8:27 pm

Recommend a sox writable format for my needs.

  • Quote

Post by Skotlex » Sat Apr 04, 2026 3:06 am

I am writing a script in which I use sox to determine some properties of a sound file, so I just need temporary files while processing the data, I wanted to use a quickly encoding/low-filesize format, yet my sox install can't write any that comes to mind (opus, ogg, speex, and I'd rather stay away from mp3).

I've normally used flac files for temporary processing, yet this time that's not practical as the file sizes are huge.

How do I find out which formats sox can write? Is MP3 really the only choice? I can't actually find any usable alternatives, there seems to be n0 documentation about this online, as I've been searching for half an hour without any progress.

Thanks in advance.
Top
b11n
Guru
Guru
User avatar
Posts: 303
Joined: Wed Mar 26, 2003 8:15 am
Location: New Zealand

Re: Recommend a sox writable format for my needs.

  • Quote

Post by b11n » Sat Apr 04, 2026 6:07 am

It's not clear what you would need this temporary file for - can sox not handle whatever format the original media is in? If that's the case, are you able to pipe raw PCM (aka .WAV) directly to/from sox, and avoid creating a temporary file in the first place? In any case, I'd avoid lossy formats for any intermediate audio work. 48kHz stereo PCM16 is well less than a GB per hour.

Can you elaborate a bit more on your process? What's "huge"?

Also, sox will support all those formats except speex (which there's really no need for in 2026) with the appropriate USE flags enabled, but again, you probably want to be using uncompressed audio for whatever processing you're doing.
Is there gas in the caaaaar?
Yes, there's gas in the caaaar
Top
Skotlex
Guru
Guru
Posts: 318
Joined: Sat Mar 13, 2004 8:27 pm

Re: Recommend a sox writable format for my needs.

  • Quote

Post by Skotlex » Sat Apr 04, 2026 4:29 pm

Thanks for the helpful reply. I don't really understand why I can't write an Opus file when the Opus flag is set, though, none of the missing useflags seem to enable these formats, I'll have to play around then.

The songs can be up to... around half an hour in length (though it's over a thousand of them and process them in parallel with eight threads), and the purpose of the calculations is to extract the timestamp of the peak value of the song. Anyway, your PCM16 sample shows I can use that, thanks. I'll see if I fix my sox install.

Code: Select all

> emerge -pv sox
[ebuild   R    ] media-sound/sox-14.4.4.1-r1:0/3::gentoo  USE="alsa encode flac id3tag mad ogg openmp opus png sndfile -amr -ao -ladspa -oss -pulseaudio -sndio -twolame -wavpack"
Top
RumpletonBongworth
Apprentice
Apprentice
User avatar
Posts: 162
Joined: Mon Jun 17, 2024 1:17 am

Re: Recommend a sox writable format for my needs.

  • Quote

Post by RumpletonBongworth » Sun Apr 05, 2026 1:17 am

PCM16 will be larger than FLAC at level 0 (obviously, since PCM16 isn't compressed). On the other hand, PCM16 might be faster to process if your workload tends more towards being CPU bound than I/O bound.
Top
Post Reply

4 posts • Page 1 of 1

Return to “Multimedia”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic