Mercurial > SDL_sound_CoreAudio
view decoders/timidity/FAQ @ 474:c66080364dff
Most decoders now report total sample play time, now. Technically, this
breaks binary compatibility with the 1.0 branch, since it extends the
Sound_Sample struct, but most (all?) programs are just passing pointers
allocated by SDL_sound around, and might be okay.
Source-level compatibility is not broken...yet! :)
--ryan.
-------- Original Message --------
Subject: SDL_sound patch: Finding total length of time of sound file.
Date: Sun, 26 Jan 2003 09:31:17 -0800 (PST)
Hi Ryan,
I am working with Eric Wing and helping him modify
SDL_sound. AS part of our efforts in improving and
enhancing SDL_sound, we like to submit this patch. We
modified the codecs to find the total time of a sound
file. Below is the explanation of the patch. The
patch is appended as an attachment to this email.
* MOTIVATION:
We needed the ability to get the total play time of a
sample (And we noticed that we're not the only ones).
Since SDL_sound blocks direct access to the specific
decoders, there is no way for a user to know this
information short of decoding the whole thing.
Because of this, we believe this will be a useful
addition, even though the accuracy may not be perfect
(subject to each decoder) or the information may not
always be available.
* CONTRIBUTORS:
Wesley Leong (modified the majority of the codecs and
verified the results)
Eric Wing (showed everyone how to do modify codec,
modified mikmod)
Wang Lam (modified a handful of codecs, researched
into specs and int overflow)
Ahilan Anantha (modified a few codecs and helped with
integer math)
* GENERAL ISSUES:
We chose the value to be milliseconds as an Sint32.
Milliseconds because that's what Sound_Seek takes as a
parameter and -1 to allow for instances/codecs where
the value could not be determined. We are
not sure if this is the final convention you want, so
we are willing to work with you on this.
We also expect the total_time field to be set on open
and never again modified by SDL_sound. Users may
access it directly much like the sample buffer and
buffer_size. We thought about recomputing the time
on DecodeAll, but since users may seek or decode small
chunks first, not all the data may be there. So this
is better done by the user. This may be good
information to document.
Currently, all the main codecs are implemented except
for QuickTime.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sat, 08 May 2004 08:19:50 +0000 |
parents | 2d887640d300 |
children |
line wrap: on
line source
---------------------------*-indented-text-*------------------------------ TiMidity -- Experimental MIDI to WAVE converter Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi> -------------------------------------------------------------------------- Frequently Asked Questions with answers: -------------------------------------------------------------------------- Q: What is it? A: Where? Well Chris, TiMidity is a software-only synthesizer, MIDI renderer, MIDI to WAVE converter, realtime MIDI player for UNIX machines, even (I've heard) a Netscape helper application. It takes a MIDI file and writes a WAVE or raw PCM data or plays it on your digital audio device. It sounds much more realistic than FM synthesis, but you need a ~100Mhz processor to listen to 32kHz stereo music in the background while you work. 11kHz mono can be played on a low-end 486, and, to some, it still sounds better than FM. -------------------------------------------------------------------------- Q: I don't have a GUS, can I use TiMidity? A: Yes. That's the point. You don't need a Gravis Ultrasound to use TiMidity, you just need GUS-compatible patches, which are freely available on the Internet. See below for pointers. -------------------------------------------------------------------------- Q: I have a GUS, can I use TiMidity? A: The DOS port doesn't have GUS support, and TiMidity won't be taking advantage of the board's internal synthesizer under other operating systems either. So it kind of defeats the purpose. But you can use it. -------------------------------------------------------------------------- Q: I tried playing a MIDI file I got off the Net but all I got was a dozen warnings saying "No instrument mapped to tone bank 0, program xx - this instrument will not be heard". What's wrong? A: The General MIDI standard specifies 128 melodic instruments and some sixty percussion sounds. If you wish to play arbitrary General MIDI files, you'll need to get more patch files. There's a program called Midia for SGI's, which also plays MIDI files and has a lot more bells and whistles than TiMidity. It uses GUS-compatible patches, too -- so you can get the 8 MB set at ftp://archive.cs.umbc.edu/pub/midia for pretty good GM compatibility. There are also many excellent patches on the Ultrasound FTP sites. I can recommend Dustin McCartney's collections gsdrum*.zip and wow*.zip in the "[.../]sound/patches/files" directory. The huge ProPats series (pp3-*.zip) contains good patches as well. General MIDI files can also be found on these sites. This site list is from the GUS FAQ: > FTP Sites Archive Directories > --------- ------------------- > Main N.American Site: archive.orst.edu pub/packages/gravis > wuarchive.wustl.edu systems/ibmpc/ultrasound > Main Asian Site: nctuccca.edu.tw PC/ultrasound > Main European Site: src.doc.ic.ac.uk packages/ultrasound > Main Australian Site: ftp.mpx.com.au /ultrasound/general > /ultrasound/submit > South African Site: ftp.sun.ac.za /pub/packages/ultrasound > Submissions: archive.epas.utoronto.ca pub/pc/ultrasound/submit > Newly Validated Files: archive.epas.utoronto.ca pub/pc/ultrasound > > Mirrors: garbo.uwasa.fi mirror/ultrasound > ftp.st.nepean.uws.edu.au pc/ultrasound > ftp.luth.se pub/msdos/ultrasound -------------------------------------------------------------------------- Q: Some files have awful clicks and pops. A: Find out which patch is responsible for the clicking (try "timidity -P<patch> <midi/test-decay|midi/test-panning>". Add "strip=tail" in the config file after its name. If this doesn't fix it, mail me the patch. -------------------------------------------------------------------------- Q: I'm playing Fantasie Impromptu in the background. When I run Netscape, the sound gets choppy and it takes ten minutes to load. What can I do? A: Here are some things to try: - Use a lower sampling rate. - Use mono output. This can improve performance by 10-30%. (Using 8-bit instead of 16-bit output makes no difference.) - Use a smaller number of simultaneous voices. - Make sure you compiled with FAST_DECAY enabled in options.h - Recompile with an Intel-optimized gcc for a 5-15% performance increase. --------------------------------------------------------------------------