22 May '13 - 12:41 *
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: Playing music from memory  (Read 441 times)
adokhugi
Posts: 2


« on: 2 Aug '12 - 16:25 »
Reply with quoteQuote

I have not found out how it is possible to play music from memory with BASS instead of file. I included the music in the project with Visual Studio 2005 as a resource. So there is a constant IDR_XM1 which points to the beginning of the tune. How can I load the tune with BASS and play it?
Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #1 on: 2 Aug '12 - 16:40 »
Reply with quoteQuote

You would pass the resource's memory location and size to BASS_MusicLoad (with mem=TRUE), something like this...

music=BASS_MusicLoad(TRUE, resdata, 0, ressize, BASS_MUSIC_RAMP, 1); // load the mod
BASS_ChannelPlay(music, 0); // play it

Please see the BASS_MusicLoad documentation for details.
Logged
adokhugi
Posts: 2


« Reply #2 on: 3 Aug '12 - 10:53 »
Reply with quoteQuote

How do I obtain the memory location of a resource in Visual C++? A Google search (https://www.google.at/#hl=de&sclient=psy-ab&q=obtaining+memory+location+of+resource+visual+c%2B%2B&oq=obtaining+memory+location+of+resource+visual+c) did not help me.
Logged
Ian @ un4seen
Administrator
Posts: 15259


« Reply #3 on: 3 Aug '12 - 15:36 »
Reply with quoteQuote

Here's an example of playing a resource (replace BASS_StreamCreateFile with BASS_MusicLoad)...

   www.un4seen.com/forum/?topic=12731
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines