#8870 closed patch
AudioStream play length querying
Reported by: | lordhoto | Owned by: | fingolfin |
---|---|---|---|
Priority: | normal | Component: | Audio |
Version: | Keywords: | ||
Cc: | Game: | Kyrandia 3 |
Description
Hi,
here's a fixed length audio stream class implementation I made. It's being used in a patch for bug #1497437, for audio/video sync like the original does there (see attached patch there). Since I'm not sure if this is the way we want to go with it I posted this on the patch tracker.
Currently missing: - Derive MP3, OGG/Vorbis and FLAC streams from FixedLengthStream, I'm not sure on how to achieve it since I'm totally unfamiliar with that code and the respective APIs
Ticket imported from: #1970427. Ticket imported from: patches/975.
Attachments (2)
Change History (10)
by , 16 years ago
Attachment: | audiostream.patch added |
---|
comment:1 by , 16 years ago
Hi, could you explain what the purpose of this is? I.e. from the description of this tracker item, it is totally unclear to me what a "Fixed size" stream does what another stream doesn't ... ?
comment:2 by , 16 years ago
The purpose is, that the new added class 'FixedLengthAudioStream' is able to query its playtime. (Which isn't possible currently without it, or I missed some things :-). Without it, it isn't possible to get the playtime of for example VOC files (well it is, if you use the plain VOC extract, which doesn't create an AudioStream on it's own), with this patch it is also possible to derive classes like the mp3, ogg/vorbis and flac player from it, so the engines creating stream objects are able to query the playtime of those. Kyra uses it for example to determine how long certain animations have to be played.
comment:3 by , 16 years ago
As stated on IRC, I agree that we absolutely need some way to query a stream for its total playing time, in order to make kyra work right. So that's agreed.
As to the way: My personal "taste" prefers adding an "int32 getTotalPlayingTime()" method to AudioStream itself, with a default implementation which returns UNKNOWN_TOTAL_PLAYING_TIME = -1 or something like that.
Also, I wonder why your getPlayTime() method takes a "rate param" ? Your patch doesn't seem to use it... And streams are always played with their built-rate anyway, I think... ?
by , 16 years ago
Attachment: | audiostream_v2.patch added |
---|
patch against current svn (Fingolfin's suggestion)
comment:4 by , 16 years ago
Just made a patch for your suggestion and attached it.
No there's no real reason, at first I thought maybe Kyra3 did something for its "Helium" mode support internally too, but I couldn't find anything. (In Kyra3 the audio files are played at a different sample rate for that effect).
File Added: audiostream_v2.patch
comment:5 by , 16 years ago
Summary: | Fixed Length Audio Stream class → AudioStream play length querying |
---|
comment:6 by , 16 years ago
Status: | new → closed |
---|
comment:8 by , 6 years ago
Component: | → Audio |
---|---|
Game: | → Kyrandia 3 |
patch against current svn