Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

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

New Hekkus Sound Library Wrapper!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-23-2007, 10:23 PM
Senior Member
 
Join Date: May 2007
Posts: 125
Default

Hi. I've done it! You are now able to create fast action games with some awesome sound effects that you have full control over while they play or even before and after they play! This library works now 100% with Basic4ppc for both the desktop and the device! You can mix unlimited MODS with the library and unlimited waves, and unlimited OGG Vorbis all at once or whenever you see fit! The library has a completely new interface and only requires 2 files each for the desktop or the device, not 3 like in the previous version. It also now works with the Optimized Compiler for v6.01 and later, and now supports OGG Vorbis. I also did away with the manual and put an example program that shows how you can use this library in your own Basic4ppc apps. To use OGG Vorbis, simply replace the .wav extension with the .ogg extension when using the load methods from music/sound and that should work. You can download the Basic4ppc library and examples library here:
http://www.BrailleSoft.net/Hekkus.zip
The native DLLS with OGG Vorbis support are attached with this message. Just replace the HssDesktop.d and HssDevice.d files with the attached files in the .zip archive for that support.
The hssDevice.d and hssDesktop.d files have been updated. Minor fixes regarding OGG were fixed, and some other important fixes were made.

Enjoy and let me know what you think!
Attached Files
File Type: zip hss.zip (176.9 KB, 168 views)

Last edited by Louis : 06-03-2009 at 08:00 PM. Reason: Native dlls updated!
Reply With Quote
Old 11-24-2007, 02:07 AM
Louis
This message has been deleted by Louis.
  #2 (permalink)  
Old 12-02-2007, 05:14 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default Great

This looks very interesting, just what my version of Lunar Lander needs some rocket noises!
Im going to try it later, anyone know any good sources for wave files that sound like a rocket engine?

Last edited by colin9876 : 12-02-2007 at 05:51 PM.
Reply With Quote
  #3 (permalink)  
Old 12-02-2007, 10:24 PM
Senior Member
 
Join Date: May 2007
Posts: 125
Default

Hi. A good place to try first is findsounds.com. Lots of free sounds you can download. Another one is ILoveWAVS.com. Even more waves you can download and use! HTH.
Reply With Quote
  #4 (permalink)  
Old 12-03-2007, 05:13 PM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Ioannina, Greece
Posts: 356
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi Louis,

I didn't test your wrapper but I had a quick look at the manual.
Wow! I'm impressed. A lot of work is here. And I should notice that you are new to this!

Well done!
__________________
Dimitris Zacharakis
http://www.terracom.gr
Reply With Quote
  #5 (permalink)  
Old 12-28-2007, 05:19 AM
Senior Member
 
Join Date: May 2007
Posts: 125
Default

See first message for info on the easier Hekkus Sound System Wrapper.
Reply With Quote
  #6 (permalink)  
Old 12-28-2007, 11:58 PM
Senior Member
 
Join Date: May 2007
Posts: 125
Default

The Hekkus wrapper has been updated see post number 1 in this thread for the changes and new download.
Reply With Quote
  #7 (permalink)  
Old 05-09-2008, 10:15 PM
pmu5757's Avatar
Knows the basics
 
Join Date: Sep 2007
Location: Metz (France)
Posts: 67
Default Hekkus lib

Hello,
Without doc, I haven't been able to know if it's possible with this lib to launch a sound, stop the program, and continue it just after the sound has finished.

Can anybody help me ?

Thank you.
__________________
Pascal
Reply With Quote
  #8 (permalink)  
Old 05-09-2008, 10:53 PM
Senior Member
 
Join Date: May 2007
Posts: 125
Default

Hi. It sure is, here's an example using only 1 sound, however you can use as many sounds as you like.
'Add a reference to HSSNetDesktop for the Desktop or HSSNetDevice for the PPC and Smartphones. Add a Speaker objet called speaker, a Sound object called sound1, and a Channel1 object called channel1. You must add a sound object and a channel1 object per everysound you want to load and manipulate from Basic4ppc.
Sub Globals
End Sub
Sub App_Start
speaker.new1
sound1.new1
channel1.new1

Speaker.Open(44100, 16, true, 0, 16) 'The parameters of the Open() function are from left to right:
Hurtz as Int32, 8 or 16 as Int32 for 8-bit or 16-bit files, stereo or mono as boolean true=stereo, Number of channels to allocate for MODS as Int32, and Number of channels to allocate for wavs as Int32.
sound1.load("FileToLoad.wav") 'Loads a wav file into sound1.
'Now to manipulate the sound as it plays, you'd code:
channel1.Value = speaker.channel(speaker.PlaySound(sound1.Value))
'And to freeze the program until a sound is done playing, use the channel1 object. The channel1 class also has some nice methods that let you control the sound while it plays and such. The class entitled Channel doesn't work with Basic4ppc, so Channel1 allows this.

'Anyway, simply code while the sound is playing:
do while channel1.Playing
'Code can go here while the sound plays if necessary.
DoEvents
loop
'When the sound is done the code after the loop executes.
'Don't forget to add a close event that closes the speaker when your program aborts via a call to speaker.close
End Sub
If anyone has more questions please let me know. HTH.
Reply With Quote
  #9 (permalink)  
Old 05-10-2008, 04:49 PM
pmu5757's Avatar
Knows the basics
 
Join Date: Sep 2007
Location: Metz (France)
Posts: 67
Default Hekkus lib

Hello Louis,
Thank you for your answer.

You say that I must add a sound object and a channel1 object per everysound you want to load and manipulate from Basic4ppc.
In my app, I have to play 99 different wav files (1.wav 2.wav ... up to 99.wav)
I've done a sub to do that :

Code:
sub tell(num)
Sound (
".\sons\" & num & ".wav")
Sleep (
1200)
End Sub
How could I do with your lib to do the same without having 99 code parts like :
speaker.new1
sound1.new1
channel1.new1

Another question : is it possible with your lib to play mp3 files ?

Thank you.
__________________
Pascal
Reply With Quote
  #10 (permalink)  
Old 05-11-2008, 01:09 AM
Senior Member
 
Join Date: May 2007
Posts: 125
Default

Hi Pascal, As of now the lib doesn't support mp3's, only MODS and wavs. And there is a way to load sounds quickly as long as your files are numbered. Check out this code:
'Add a Speaker object named Speaker using Tools - Add Object after making a reference to HSSNETDesktop or HSSNETDevice.dll
Sub Globals
End Sub
Sub App_Start
speaker.New1
speaker.open(44100, 16, true, 0, 16)
'And now let's get the sounds we want.
for i = 1 to 99
AddObject("sound" & i, "Sound")
'Without the optimized compiler:
control("Sound" & i).New1
'With the optimized compiler maybe:
control("Sound" & i,Sound).New1
AddObject("Channel" & i, "Channel1")
'Without the optimized compiler:
control("Channel" & i).New1
'With the optimized compiler maybe:
controll("Channel" & i,Channel1).New1
'Then load the sound.
'Without the optimized compiler:
control("Sound" & i).load("File" & i & ".wav")
'with the optimize compiler maybe:
control("Sound" & i,Sound).load("filename" & i & ".wav")
next
'Now you can play whatever sound you like! Here is code that'll play a random sound for you, and assign the channel to it in case you want to mod it while the sound plays.
a = rnd(1, 100)
'Without the optimized compiler code:
control("Channel" & a).Value = speaker.channel(speaker.playSound(control("Sound" & a).Value))
'With the optimized compiler you might have to code:
control("channel" & a,Channel1).Value = speaker.channel(speaker.playSound(control("Sound" & a,Sound).value))
'If you want to modify the sound, use any of the methods in the Channel1 class to do so.
'Don't forget to add a close event to the form that calls speaker.close before your app ends!
End Sub
Please note: Hekkus loads and compresses sounds into memory so they'll play as soon as you call speaker.PlaySound(). Because you have 99 sounds loading, this may take about 30 seconds or less depending on how big the files are, and how fast your device is. The desktop loads files wihin seconds so there is no delay there because of how fast the processors are. If you have more questions please let me know. HTH.
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
help on playing sound sanoy Questions (Windows Mobile) 4 11-08-2008 12:03 AM
The Hekkus Library doesn't work when used with the Optimized Compiler Louis Questions (Windows Mobile) 5 12-28-2007 08:06 PM
SOund Input? PKinz Basic4ppc Wishlist 1 12-12-2007 02:51 PM
Hekkus Sound System wrapper Louis Additional Libraries 18 09-27-2007 12:35 PM
Sound/Mic input Bill Todd Questions (Windows Mobile) 2 06-22-2007 11:29 AM


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


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0