26 May '13 - 00:20 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Is my code wrong?  (Read 371 times)
big_gun
Posts: 342


« on: 6 May '12 - 20:20 »
Reply with quoteQuote

It's been a while since I've played with the api, and for some reason I cannot get it to play correctly. It plays only the first couple notes, stuttering. Here's the code

           int streamId = Un4seen.Bass.Bass.BASS_StreamCreateFile(fileName, 0L, 0L, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_STREAM_PRESCAN);
            if (streamId != 0)
            {
                int fx = Un4seen.Bass.AddOn.Fx.BassFx.BASS_FX_TempoCreate(streamId, BASSFlag.BASS_FX_FREESOURCE | BASSFlag.BASS_STREAM_AUTOFREE);

                if (fx != 0)
                {
                    Un4seen.Bass.Bass.BASS_ChannelPlay(fx, false);
                }
            }

I am using the bass.net library, and many songs, it is just clicking...
« Last Edit: 6 May '12 - 20:25 by big_gun » Logged
radio42
Posts: 4012


« Reply #1 on: 7 May '12 - 10:25 »
Reply with quoteQuote

Your code looks fine as far as I can see.
So how have you initialized BASS?
And did you get the same problem without the Tempo stream?
Logged
big_gun
Posts: 342


« Reply #2 on: 7 May '12 - 15:43 »
Reply with quoteQuote

Your code looks fine as far as I can see.
So how have you initialized BASS?
And did you get the same problem without the Tempo stream?

No, I am trying to use the tempo, so I can change pitch. I initialized bass just fine, with 44100, -1 device.

I tried multiple files, and it occassionally works, but most of the time it stutters. I am starting to think it is the computer.
Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #3 on: 8 May '12 - 15:15 »
Reply with quoteQuote

For comparison, you could try running the pre-compiled TEMPO.EXE example from the BASS_FX package (C\BIN directory) and see if you get the same problem with that. If you do get the problem with that, you could then try running one of other (non-tempo) pre-compiled examples to confirm whether it's specific to the tempo stuff.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines