19 Jun '13 - 13:27 *
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: BASS_ATTRIB_TEMPO_PITCH throws IllType error  (Read 322 times)
SpiritBoy
Posts: 4


« on: 30 Apr '12 - 11:04 »
Reply with quoteQuote

I have the following line of code -
Bass.BASS_ChannelSetAttribute(_handle, BASSAttribute.BASS_ATTRIB_TEMPO_PITCH, Pitch);
The function returns false, and checking with Bass.BASS_ErrorGetCode() gives me the BASS_ERROR_ILLTYPE error. Since that attribute is also listed in the help doc, I have trouble seeing what's the problem here. Handle was created with BASS_StreamCreateFile, if that changes anything in anyway.
Logged
radio42
Posts: 4030


« Reply #1 on: 30 Apr '12 - 12:55 »
Reply with quoteQuote

What type is 'Pitch' of and what value are you using when making that call?
Logged
Ian @ un4seen
Administrator
Posts: 15363


« Reply #2 on: 30 Apr '12 - 15:11 »
Reply with quoteQuote

A BASS_ERROR_ILLTYPE error indicates that the attribute type is invalid, at least for the specified channel, ie. your "_handle" channel doesn't support the BASS_ATTRIB_TEMPO_PITCH attribute in this case. Note the BASS_ATTRIB_TEMPO_PITCH attribute is only supported by tempo streams, created with BASS_FX_TempoCreate. To apply it to a file, you need to wrap the file in a tempo stream, something like this...

decoder=BASS_StreamCreateFile(FALSE, filename, 0, 0, BASS_STREAM_DECODE); // create a "decoding channel" from a file
tempostream=BASS_FX_TempoCreate(decoder, BASS_FX_FREESOURCE); // create a tempo stream for it
BASS_ChannelSetAttribute(tempostream, BASS_ATTRIB_TEMPO_PITCH, pitch); // set the pitch
BASS_ChannelPlay(tempostream, FALSE); // start playing

Please see the documentation for details on the aforementioned stuff.
Logged
SpiritBoy
Posts: 4


« Reply #3 on: 30 Apr '12 - 22:48 »
Reply with quoteQuote

A BASS_ERROR_ILLTYPE error indicates that the attribute type is invalid, at least for the specified channel, ie. your "_handle" channel doesn't support the BASS_ATTRIB_TEMPO_PITCH attribute in this case. Note the BASS_ATTRIB_TEMPO_PITCH attribute is only supported by tempo streams, created with BASS_FX_TempoCreate. To apply it to a file, you need to wrap the file in a tempo stream, something like this...

decoder=BASS_StreamCreateFile(FALSE, filename, 0, 0, BASS_STREAM_DECODE); // create a "decoding channel" from a file
tempostream=BASS_FX_TempoCreate(decoder, BASS_FX_FREESOURCE); // create a tempo stream for it
BASS_ChannelSetAttribute(tempostream, BASS_ATTRIB_TEMPO_PITCH, pitch); // set the pitch
BASS_ChannelPlay(tempostream, FALSE); // start playing

Please see the documentation for details on the aforementioned stuff.

Cheers! Didn't realize I had to wrap it. Thanks, it works now Smiley
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines