[haiku-development] Re: Calculate time in minutes

  • From: Marcus Overhagen <marcus.overhagen@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 4 Dec 2012 22:13:18 +0100

On Tue, Dec 4, 2012 at 2:05 PM, Giovanni Mugnai <musical777@xxxxxxxxx> wrote:

> But i can't still insert wav files.. If is not a problem for you, i
> wait patiently when you can take some time to exactly look at the code

The Haiku Media kit will convert any mp3, wav, aiff, avi, mpeg etc. file
into 16 bit int raw, good for audio, provided that the files are
44100Hz stereo (which allmost all files are). You need to request the
correct
format from BMediaTrack::DecodedFormat
something like:

        media_raw_audio_format format;
        format = media_raw_audio_format::wildcard;
        format.frame_rate = 44100;
        format.channel_count = 2;
        format.format = media_raw_audio_format::B_AUDIO_SHORT;
        format.byte_order = B_MEDIA_LITTLE_ENDIAN;

regards
Marcus

Other related posts: