23 May '13 - 22:05 *
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 tunes from the resource  (Read 618 times)
!artem!
Guest
« on: 18 Jun '11 - 16:08 »
Reply with quoteQuote

I have to share some *. wav files
how to play a *. wav file located in the resource?

PS
I write with the aid of google translator, I'm sorry if there are errors
Logged
Ian @ un4seen
Administrator
Posts: 15270


« Reply #1 on: 20 Jun '11 - 15:34 »
Reply with quoteQuote

You can use the FindResource and LoadResource functions to "load" the resource, and then use LockResource and SizeofResource to get the address and size of it, which you can then use in a BASS_StreamCreateFile call. Something like this...

HRSRC rsrc=FindResource(NULL, resourcename, RT_RCDATA);
HGLOBAL global=LoadResource(NULL, rsrc);
HSTREAM stream=BASS_StreamCreateFile(TRUE, LockResource(global), 0, SizeofResource(NULL, rsrc), 0);
BASS_ChannelPlay(stream, FALSE);
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines