Author Topic: Asio gapless check  (Read 144 times)

udo

  • Posts: 32
Asio gapless check
« on: 23 Jan '18 - 12:43 »
Hi,
is there a way to prove the gapless-play?
I have done that with playing identical files(sinus) and a Oszi at Soundcard-Speaker output but i would need that directly at BassAsio-Out.
Any ideas? :)

Ian @ un4seen

  • Administrator
  • Posts: 20767
Re: Asio gapless check
« Reply #1 on: 23 Jan '18 - 16:51 »
You could write the sample data to a file in your ASIOPROC function, and then look at that file in a sample editor.

udo

  • Posts: 32
Re: Asio gapless check
« Reply #2 on: 23 Jan '18 - 17:48 »
You could write the sample data to a file in your ASIOPROC function, and then look at that file in a sample editor.

OK. I have done this code but i guess i have to write more(header?) to use it with an editor(Adobe Audition):
Code: [Select]
private int AsioOutProc(bool input, int channel, IntPtr buffer, int length, IntPtr user)
        {
            if (OutStreamAsio == 0)
                return 0;

            int c = Bass.BASS_ChannelGetData(user.ToInt32(), buffer, length);

            if (c == -1)
            {
                c = 0; // an error, no data
            }

            if (c > 0)
            {
                string fn = @"D:\\Asio.dat";
                FileStream fs = null;
                if (File.Exists(fn))
                {
                    fs = new FileStream(fn, FileMode.Append);
                }
                else
                {
                    fs = new FileStream(fn, FileMode.CreateNew);
                }
                if (fs != null)
                {
                    BinaryWriter w = new BinaryWriter(fs);
                    byte[] managedArray = new byte[length];
                    Marshal.Copy(buffer, managedArray, 0, length);
                    w.Write(managedArray);
                    w.Close();
                }
            }

            return c;
        }

Or is there something at Bass to create the right File?

Ian @ un4seen

  • Administrator
  • Posts: 20767
Re: Asio gapless check
« Reply #3 on: 24 Jan '18 - 13:40 »
You could use the BASSenc add-on to set a WAV writer on the BASS channel that you're using in the BASS_ChannelGetData call, something like this:

Code: [Select]
BASS_Encode_Start(mixer, "mix.wav", BASS_ENCODE_PCM|BASS_ENCODE_QUEUE|BASS_ENCODE_AUTOFREE, NULL, NULL);

Please see the BASS_Encode_Start documentation for details.