Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


Hekkus Sound System wrapper


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 08-27-2007, 10:54 AM
Knows the basics
 
Join Date: May 2007
Posts: 82
Default

Thank Louis, but .wav file is much larger then .mp3 file. And do you know any software to convert .mp3 to .mod ?
Reply With Quote
  #12 (permalink)  
Old 08-27-2007, 02:22 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by conf View Post
And do you know any software to convert .mp3 to .mod ?
Sorry but I don't think that this is possible. A mod file is essentially a description of synthesized intruments and an associated score rather than being an actual audio file. So you could "play" a mod file into any audio format (wav, mp3 ogg etc..) but you can't go the other way.

However the FMOD library included with B4PPC that interfaces to the Firelight Technologies FMOD libraries can play mp3 and ogg so why don't you try that?
Reply With Quote
  #13 (permalink)  
Old 08-27-2007, 02:30 PM
Knows the basics
 
Join Date: May 2007
Posts: 82
Default

Thank you Agraham. I learned so much
Reply With Quote
  #14 (permalink)  
Old 08-27-2007, 07:28 PM
Knows the basics
 
Join Date: May 2007
Posts: 98
Default

Hi Agraham, The reason why i recommended this library in the first place is because the FMOD library does NOT play multiple sounds at once, but if it did yes it would be my first recommendation; even if you have 2 objects created of the FMOD type class using Basic4ppc. HTH.
Quote:
Originally Posted by agraham View Post
Sorry but I don't think that this is possible. A mod file is essentially a description of synthesized intruments and an associated score rather than being an actual audio file. So you could "play" a mod file into any audio format (wav, mp3 ogg etc..) but you can't go the other way.

However the FMOD library included with B4PPC that interfaces to the Firelight Technologies FMOD libraries can play mp3 and ogg so why don't you try that?
Reply With Quote
  #15 (permalink)  
Old 09-27-2007, 02:03 AM
Knows the basics
 
Join Date: May 2007
Posts: 98
Default

Hi Erel, Thanks so much for your help in this matter. There is one last question and actually this library would be completely wrapped for b4ppc. There is a channels class, however the new1 method you call needs the memory pointer, which is a intPTR typed variable so that each object you create can manipulate the sounds at runtime. I tried this code and got the following error:
'Create an object of type sound called sound1, another one called speaker of type speaker, another one of type const called constant, and one more of type channel called channel1.
Sub Globals
End Sub
Sub App_Start
form1.show
sound1.new1
speaker.new1
constant.new1
speaker.Open(44100, 16, true, 0, 16)
sound1.load("jet.wav", constant.HSS_PlayFree)
c = speaker.PlaySound(sound1.value) 'Returns the channel the current playing file is located on.
d = speaker.channel(c) 'Returns a pointer to the channel currently specified by PlaySound and/or PlayMusic.
channel1.new1(d)
channel1.position(200)
End Sub
Sub form1_close
speaker.close
End Sub

Basic4ppc Error
Input string was NOT in a correct format.

The line it is commenting on which you will see is channel1.new1(d). Is there a way to pass pointers in Visual Basic maybe have another value property for the speaker and constant objects that can accept any type of value so Basic4ppc's conversion won't get in the way of this, and that speaker.value and/or constant.value can be passed to the channel object? E.G.
Sub App_Start
speaker.new1
constant.new1
speaker.open(44100, 16, true, 0, 16)
sound1.new1
sound1.load("jet.wav", constant.HSS_Play_Free)
constant.value = speaker.PlaySound(sound1.value)
speaker.value = speaker.channel(constant.value))
channel1.new1(speaker.value)
channel1.position(200)
End Sub
...
? You have done a good job. And this library will be 100% complete if we can somehow get this error out of the way. Thanks again, and Erel and everyone keep up the great work!
Reply With Quote
  #16 (permalink)  
Old 09-27-2007, 07:07 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

Try to pass the pointer directly:
channel1.new1(speaker.channel(speaker.PlaySound(so und1.value) ))
Reply With Quote
  #17 (permalink)  
Old 09-27-2007, 07:53 AM
Knows the basics
 
Join Date: May 2007
Posts: 98
Default

Quote:
Originally Posted by Erel View Post
Try to pass the pointer directly:
channel1.new1(speaker.channel(speaker.PlaySound(so und1.value) ))
I tried that and got another error saying the input string was not in a correct format.
Reply With Quote
  #18 (permalink)  
Old 09-27-2007, 09:26 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

Next version of Basic4ppc will support pointers conversation (IntPtr).
Then you will be able to use Music/Sound.UnmanagedObject.
Reply With Quote
  #19 (permalink)  
Old 09-27-2007, 01:35 PM
Knows the basics
 
Join Date: May 2007
Posts: 98
Default

Erel you're the man! Thanks.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Hekkus Sound Library Wrapper! Louis Additional Libraries 15 10-13-2008 03:11 AM
Phone and Message - handing off to system Offbeatmammal Questions & Help Needed 4 06-03-2008 11:03 AM
Portable (very) development system agraham Chit Chat 2 01-24-2008 09:37 AM
The Hekkus Library doesn't work when used with the Optimized Compiler Louis Questions & Help Needed 5 12-28-2007 09:06 PM
Reload system fonts on run Mistrel Basic4ppc Wishlist 2 10-16-2007 09:54 PM


All times are GMT. The time now is 10:12 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0