|
play_sample, delay in sound when looping |
Jesse Shepherd
Member #1,320
May 2001
|
Hello, Allegro (4.2) function in question: play_sample(const SAMPLE *spl, int vol, int pan, int freq, int loop); I call the following line to play my_sample, loaded from a wav file: play_sample(my_sample, 255, 128, 1000, TRUE); When the sample is about to loop, a slight delay occurs before the sample plays again from the start. Is there something I could be doing in regards to a more seamless sounding loop? Thanks very much for any information |
weapon_S
Member #7,859
October 2006
|
Perhaps the sample itself has a little silence...? Try editing in audacity. |
Jesse Shepherd
Member #1,320
May 2001
|
There was silence in the sample- I didn't look closely enough. I've lost all credibility to ask questions on here, ha. Thanks man |
wolf_wolf17
Member #13,811
December 2011
|
I made a post like this too, I felt like you feel now. But then again, they say humiliation makes a humble man.
|
Arthur Kalliokoski
Second in Command
February 2005
|
The hardware guys say experience is directly proportional to the amount of equipment ruined, so I guess programming experience is proportional to the mistakes that were so embarrassing you're determined not to make them again. I myself just went through two hours of frustration trying to remember how to get UV coordinates in an OBJ file exported by Blender, and I'm pretty sure I'll remember next time. They all watch too much MSNBC... they get ideas. |
Felix-The-Ghost
Member #9,729
April 2008
|
Arthur Kalliokoski said: I guess programming experience is proportional to the mistakes that were so embarrassing you're determined not to make them again
For me, this caused headaches yesterday: for (int i = 0; i < 1337; i++); { if (i % 2 = 0) some_var = i * i - i; } I never noticed such a problem, and there was no compiler warning. |
Arthur Kalliokoski
Second in Command
February 2005
|
I've done that a dozen or so times also, and I've read the compiler doesn't warn you because so many people use a bare loop for a delay. It's the muscle memory in your pinky that puts that colon there. They all watch too much MSNBC... they get ideas. |
Thomas Fjellstrom
Member #476
June 2000
|
Arthur Kalliokoski said: It's the muscle memory in your pinky that puts that colon there. Heh, took me a moment to figure out what you meant. Didn't even see that. I did however see this: 'if (i % 2 = 0)' -- |
weapon_S
Member #7,859
October 2006
|
Same as Thomas... al_clear_to_color(al_map_rgb(255, 225, 255); al_draw_rotated_tinted_bitmap(al_map_rgba(127, 127, 255, 255), 0.0f, 0.0f, 0.5f * BMP_WIDTH, 0.5f * BMP_HEIGHT, 0.5f * ALLEGRO_PI, 0); Spent a couple of hours figuring out how a call to al_draw_rotated_tinted_bitmap could turn my screen pink. |
gnolam
Member #2,030
March 2002
|
Felix-The-Ghost said: I never noticed such a problem, and there was no compiler warning.
Quote: if (i % 2 = 0) i % 2 isn't an lvalue (and as such can't be assigned to), so that can't compile... -- |
Arthur Kalliokoski
Second in Command
February 2005
|
He didn't have that in there when I responded. They all watch too much MSNBC... they get ideas. |
|