#64418 - blaisef01 - Thu Dec 22, 2005 5:05 am
Hi,
Is there anyway of playing a looped sound [but not from the beginning] without having to delve into the black arts which are interrupts and cascading timers?
Cheers
#64426 - gladius - Thu Dec 22, 2005 7:17 am
Not quite sure what you mean. The DS's built in channels support looping at arbitrary points within the sample. If you mean starting playbakc of a sample (with looping) at an arbitrary point, you can do that as well.
Only if you need to dynamically generate your sound will you need to start using interrupts and timers (which are not too bad really).
#64428 - blaisef01 - Thu Dec 22, 2005 9:57 am
That's exactly what i wanted to do, all i gotta do now is figure out how...
Cheers
#68519 - ventilo - Wed Jan 25, 2006 8:39 am
Hi,
Could you please keep us posted on your achievements ? I'm interested in the subject because there is not much information about looping sounds with libnds....
As for me I've tried in arm7 code using the SOUND_REPEAT flag (in place of SOUND_ONE_SHOT), and also setting SCHANNEL_REPEAT_POINT(channel) to various values (data pointer or offset...), to no avail, my sample just doesn't get repeated.
_________________
Firstname's Y.A.N.N..... yet another NDS noob :o)
#69124 - blaisef01 - Sat Jan 28, 2006 4:30 pm
Hi Ventilo
To Repeat a sound do as normal but:
SCHANNEL_REPEAT_POINT(i) = loopstart >> 2;
SCHANNEL_LENGTH(i) = len >> 2;
where loopstart is the offset from the start of the sample in bytes.
where len is the (length of the sample - loopstart) in bytes
Hope this helps....
#69372 - ventilo - Mon Jan 30, 2006 11:04 am
Okay thanks, it works now, only I did something wrong trying to transmit a "one_shot" parameter to the arm7 routine.
Thanks again :o)
_________________
Firstname's Y.A.N.N..... yet another NDS noob :o)
#69815 - rychan - Thu Feb 02, 2006 4:49 am
Does anyone know how to play long sounds on the DS? Stuck bogged down with 64kb of arm7 space isn't really much.
Coukldn't find anything in the devkitpro examples that showed it
#69817 - ProblemBaby - Thu Feb 02, 2006 4:57 am
Quote: |
Does anyone know how to play long sounds on the DS? Stuck bogged down with 64kb of arm7 space isn't really much.
|
You can play sounds from main memory thats 4mb, if I you want even bigger you have to stream.
I aint sure about the easiest way to put data in main memory. But I know that you can include it in your arm9 source and send the pointer to the arm7.
#108374 - walaber - Wed Nov 08, 2006 6:42 am
is there any way to play a sound with libnds from standard arm9 code that will cause the sound to loop?
all of the code above appears to be arm7 code... is that correct?
_________________
Go Go Gadget NDS!
#108387 - 0xtob - Wed Nov 08, 2006 11:48 am
Nopel, unfortunately, you'll have to mess with registers on the Arm7. libnds definitely needs some improvement of the sound functions.
#108406 - silent_code - Wed Nov 08, 2006 3:32 pm
second that!