|   |  | 
| Sound problems | 
| YerbiDer Member #14,021 February 2012 | Here I have a simple part of a code:   1(...)
  2ALLEGRO_SAMPLE *song = NULL;
  3ALLEGRO_SAMPLE_ID* SWITCH;
  4(...)
  5song = al_load_sample("DATA/SOUND/GoGo.ogg");
  6  if(!song){
  7              fprintf(stderr, "failed to create sound 3!\n");
  8              }
  9(...)
 10al_play_sample(song, 0.8, 0, 1, ALLEGRO_PLAYMODE_LOOP, SWITCH);
 11(...)
 On my laptop it works perfectly. The music plays and stops when it should, but on my PC the game crashes on al_play_sample(). When I delete the sample_id part(or turn off the music by the game menu) it works fine, but i can't stop the music ><". | 
| Matthew Leverton Supreme Loser January 1999  | ALLEGRO_SAMPLE_ID SWITCH; al_play_sample(song, 0.8, 0, 1, ALLEGRO_PLAYMODE_LOOP, &SWITCH); 
 | 
| YerbiDer Member #14,021 February 2012 | Thank you. And can you explain me shortly why it's this way? | 
| Matthew Leverton Supreme Loser January 1999  | Allegro assumes you have already reserved the space for the sample id, so you need to pass it a pointer that points to a valid block of memory. ALLEGRO_SAMPLE_ID foo; // reserves space ALLEGRO_SAMPLE_ID *fooptr; // points to some arbitrary location 
 | 
|  |