VOGONS


CUE/ISO/MP3 does not work

Topic actions

First post, by garyzyg

User metadata
Rank Newbie
Rank
Newbie

My game: Pal
http://www.dosbox.com/comp_list.php?showID=3113&letter=P

I can hear compressed audio tracks with CUE/ISO/OGG but not CUE/ISO/MP3 and CUE/ISO/WAVE. (I am sure the CUE file is correct.)

MSCDEX of Dosbox 0.72/CVS shows that the image is mounted correctly. I also try to trace the sources, but AudioFile::read() and AudioFile::getLength() seem not to be entered if I use CUE/ISO/MP3.

Reply 1 of 25, by gilgamesh

User metadata
Rank Newbie
Rank
Newbie

Sorry for the delay.

I assume that you are using dosbox under linux, since I am facing the same kind of trouble (though I don't mind 😉).

The MP3 codec is probably not registered with SDL_sound. Are the necessary codes installed? If they are, then I would try to recompile SDL.

Reply 2 of 25, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

There were a discussion here recently about some bug in DOSBox or SDL wrt. calculating time and length of audio files in images. Maybe you hit the same problem?

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 3 of 25, by gilgamesh

User metadata
Rank Newbie
Rank
Newbie
MiniMax wrote:

There were a discussion here recently about some bug in DOSBox or SDL wrt. calculating time and length of audio files in images. Maybe you hit the same problem?

I don't think so. The "wrong lenght error" is rather exotic and most games will simply ignore it.
Here one codec works, another one does not. I really think this comes from outside dosbosx.

Reply 4 of 25, by garyzyg

User metadata
Rank Newbie
Rank
Newbie

Yes, I use Linux.

I use Sound_AvailableDecoders() declared in SDL_sound.h to list availe decoders, and SDL_sound is built with internal mpg123. I also try official dosbox win32 version in windows xp, and this combination CUE/ISO/MP3 still does not work.

So I got the conclusion: maybe SDL_sound is buggy.

Reply 5 of 25, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

you know what is odd. In the cue parsing functions there is code to detect MP3 as type, but not OGG.
So in a way it is odd that OGG works and MP3 doesn't.
You can easely remove the MP3 special detection. Maybe it works then.
(src/dos/cdrom_image.cpp)

Water flows down the stream
How to ask questions the smart way!

Reply 6 of 25, by garyzyg

User metadata
Rank Newbie
Rank
Newbie

I tried, and it does not work.

The author of SDL_sound claims that he does not implement some parts on http://icculus.org/SDL_sound/.

I think it is the problem of SDL_sound not dosbox. (The decoding part does not do anything wrong.)

Reply 7 of 25, by gilgamesh

User metadata
Rank Newbie
Rank
Newbie
Qbix wrote:

you know what is odd. In the cue parsing functions there is code to detect MP3 as type, but not OGG.
So in a way it is odd that OGG works and MP3 doesn't.

If I remeber that right, the cuesheet standard does not list a special tag for ogg. So the MP3-tag is nothing but a tag, bearing no significance but that a compressed file is used. Sorting out the correct algo is done by SDL_sound.

Reply 9 of 25, by garyzyg

User metadata
Rank Newbie
Rank
Newbie
FILE "a01.iso" BINARY
TRACK 01 MODE1/2048
INDEX 01 00:00:00
FILE "a02.mp3" MP3
TRACK 02 AUDIO
INDEX 01 00:00:00
FILE "a03.mp3" MP3
TRACK 03 AUDIO
INDEX 01 00:00:00
FILE "a04.mp3" MP3
TRACK 04 AUDIO
INDEX 01 00:00:00
FILE "a05.mp3" MP3
TRACK 05 AUDIO
INDEX 01 00:00:00
FILE "a06.mp3" MP3
TRACK 06 AUDIO
INDEX 01 00:00:00
FILE "a07.mp3" MP3
TRACK 07 AUDIO
INDEX 01 00:00:00
FILE "a08.mp3" MP3
TRACK 08 AUDIO
INDEX 01 00:00:00
FILE "a09.mp3" MP3
TRACK 09 AUDIO
INDEX 01 00:00:00

C_SDL_SOUND have to be enabled and mscdex in dosbox can imgmount the cue file without error.

Reply 10 of 25, by gilgamesh

User metadata
Rank Newbie
Rank
Newbie

Well, taking a closer look at cdrom_image.cpp shows that the tags WAVE, AIFF and MP3 synonymously result in calling AudioFile's constructor and thus in Sound_NewSampleFromFile. The sample structure is delivered by SDL_sound and no distinction takes place according to the underlying file format, no matter whether it is ogg or mp3.

Reply 14 of 25, by gilgamesh

User metadata
Rank Newbie
Rank
Newbie

The sample structure is a kind of abstraction that SDL_sound lays over the audio file. All audio files look like a uncompressed data stream. The rendering is done transparently inside SDL_sound

I cite from the SDL_sound docs:

if you specify, for example, "mp3" for an extension, and one of the decoders lists that as a handled extension, then that decoder is given first shot at trying to claim the data for decoding. If none of the extensions match (or the extension is NULL), then every decoder examines the data to determine if it can handle it, until one accepts it.

Getting mp3 to work under linux is alway a bit of a problem. But it should work under windows, at least. Maybe SDL_sound wants some special flags to set or something like that?

Reply 15 of 25, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The sample structure is a kind of abstraction that SDL_sound lays over the audio file.

Yes but why would it work for .ogg then, assuming the TAG is OGG
which does not create an AudioFile instance that'd use SDL_sound.

Reply 16 of 25, by gilgamesh

User metadata
Rank Newbie
Rank
Newbie
wd wrote:

Yes but why would it work for .ogg then, assuming the TAG is OGG

I always use MP3 as the tag for compressed files, even for ogg-files. Using a tag OGG produces an error message, if I remember that correctly. There is no special OGG tag in the cuesheet standard. Therefore you always get an AudioFile.

Reply 18 of 25, by gilgamesh

User metadata
Rank Newbie
Rank
Newbie
wd wrote:

Ok so that could be fixed by just adding the OGG tag, thanks for your explanation.

Well, no. SDL_sound determines the contents of a file on its own. The name of the tag plays no role whatsoever.

The funny thing is that SDL_sound throws no error when it encounters mp3. It just refuses to play it - silently.

Reply 19 of 25, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The name of the tag plays no role whatsoever.

It DOES play a role as usually ogg tracks are tagged OGG thus would be
ignored in the dosbox cue sheet code. But that's not the topic anyways,
i was just curious why ogg would work at all.