gap-dev-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gap-dev-discuss] Cynthiune: song inspector without title bar


From: Riccardo Mottola
Subject: Re: [Gap-dev-discuss] Cynthiune: song inspector without title bar
Date: Sat, 05 May 2012 15:08:17 +0200
User-agent: Mozilla/5.0 (X11; FreeBSD i386; rv:12.0) Gecko/20120430 Firefox/12.0 SeaMonkey/2.9

Hi,

you mean that you need to "force" the output to be always little endian because that is what comes from the file played? Perhaps the files (or only certain files) have an endianness tag and/or know format? For example AIFF files are usually big endian or, on modern macs, little-endian (AIFF/SWOT). I wonder how this is handled by audiofile.
WAV is known to be LE (RIFF)

MP3 I don't know. Of ocurse, the library might already compensate that. I never tackled audio programming.

If you are confident that you need to set always "LE", then commit the patch and we shall look at the ALSA and AO backends.

Riccardo


Sebastian Reitenbach wrote:

I was able to fix the problem for the Sndio Output Bundle. I remembered the 
manual page:

http://www.openbsd.org/cgi-bin/man.cgi?query=sio_open&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html

The struct sio_par has a parameter le, which defines the Endianess. Setting this
parameter to LE, makes the sound work again for me on i386 and on macppc.

A patch would look liek this:

Index: Sndio.m
===================================================================
RCS file: /sources/gap/gap/user-apps/Cynthiune/Bundles/Sndio/Sndio.m,v
retrieving revision 1.2
diff -u -r1.2 Sndio.m
--- Sndio.m     1 May 2012 12:44:46 -0000       1.2
+++ Sndio.m     5 May 2012 11:01:00 -0000
@@ -108,6 +108,7 @@
    sio_initpar(&par);
    par.pchan = numberOfChannels;
    par.rate = sampleRate;
+  par.le = 1;

    if (sio_setpar(hdl,&par))
      {


Don't know whether other output libraries have the same functionality
to force it to little endian.

Sebastian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]