UserDataAudio doc missing soundformatinfo

Bug #732448 reported by Nox_firegalaxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panda3D
Fix Released
Wishlist
rdb

Bug Description

The doc about UserDataAudio does not tell anything about the expected format. Adding this info may help people to work with this class.
The format is afaik (word=signed short):
1. word = 1. sample channel 1
...
n. word = 1. sample channel n
n+1. word = 2. sample channel 1
...
2n. word = 2. sample channel n

or as explicit formular: n. word = (trunc(n/channel_count)+1) sample channel (n%channel_count+1)

Revision history for this message
Nox_firegalaxy (nox-7bitfaster) wrote :

A patch which adds some doc + extends UserAudioData+UserAudioDataCursor without breaking the old interface or behaviour. But it enables UserAudioData to be looped and show the length correctly.

Revision history for this message
Nox_firegalaxy (nox-7bitfaster) wrote :

An the changed files. Maybe they are more useful.

Revision history for this message
rdb (rdb) wrote :

Looks mostly OK, besides that it occasionally doesn't adhere to the coding style. I just don't like the naming of the stream_like parameter, it is not obvious to me what it is supposed to mean. Could you explain more about it, and maybe we can come up with a more intuitive name and better documentation of it.

Changed in panda3d:
importance: Undecided → Wishlist
status: New → Opinion
Revision history for this message
Nox_firegalaxy (nox-7bitfaster) wrote :

The old/current implementation of UserAudioData push the given data in a buffer and pop the data if read. So currently UserAudioData behaves like a stream or a FIFO container. The patch allows to use UserAudioData like a "static" buffer without poping and with a correct length-information.
So "stream_like" determinates if UserAudioData keeps the data and updates the length correctly or if the data are popped after read.

Revision history for this message
Nox_firegalaxy (nox-7bitfaster) wrote :

P.S: or as written in the comment of UserDataAudio: "// Description : A UserDataAudio is a way for the user to manually
// supply raw audio samples. stream_like means the
// data will be removed if read once. Else data will
// be stored (enable looping and seeking)."
Dont know which formulation is more precise...

Revision history for this message
rdb (rdb) wrote :

Then would a name like static_buffer perhaps make more sense?

Revision history for this message
Nox_firegalaxy (nox-7bitfaster) wrote :

Well its only "static" after calling close but due to the fact that i have not a better proposal we should take it.

Revision history for this message
rdb (rdb) wrote :

Committed to the CVS head.

Changed in panda3d:
assignee: nobody → rdb (rdb)
milestone: none → 1.8.0
status: Opinion → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.