Modifications

Sauter à la navigation Sauter à la recherche
aucun résumé de modification
Ligne 19 : Ligne 19 :     
Note that this here is a snippet, use the examples in the library for the 'full listing'
 
Note that this here is a snippet, use the examples in the library for the 'full listing'
  <nowiki>
+
  <nowiki>AF_Wave card;
 
  −
AF_Wave card;
        Ligne 53 : Ligne 51 :  
You'll need to make a character array 13 characters long to store the 8.3 + terminating 0 of the file. Here is an example of displaying the name of each file available. When done, it resets the directory.
 
You'll need to make a character array 13 characters long to store the 8.3 + terminating 0 of the file. Here is an example of displaying the name of each file available. When done, it resets the directory.
   −
<code>
+
<nowiki>void ls() {
void ls() {
   
   char name[13];
 
   char name[13];
 
   int ret;
 
   int ret;
Ligne 69 : Ligne 66 :  
   }
 
   }
 
}
 
}
</code>
+
</nowiki>
    
== Opening a file for playing ==
 
== Opening a file for playing ==
Ligne 75 : Ligne 72 :  
There are two steps to opening a file for playing. The first is to just open the file itself, then the file must be converted to a wavefile. That means the file is read and checked for a wavetable header. To open a file, you just need the name, you can pass in a string such as "MYSOUND.WAV" or read through the directory and use the name returned from '''get_next_name_in_dir()'''. Since long names arent supported (to keep the library smaller) you may want to use ls() function above to see what the 8.3 format name of the file is.
 
There are two steps to opening a file for playing. The first is to just open the file itself, then the file must be converted to a wavefile. That means the file is read and checked for a wavetable header. To open a file, you just need the name, you can pass in a string such as "MYSOUND.WAV" or read through the directory and use the name returned from '''get_next_name_in_dir()'''. Since long names arent supported (to keep the library smaller) you may want to use ls() function above to see what the 8.3 format name of the file is.
   −
<code>
+
<nowiki>AF_Wave card;
 
  −
AF_Wave card;
   
File f;
 
File f;
 
Wavefile wave;      // only one!
 
Wavefile wave;      // only one!
Ligne 94 : Ligne 89 :     
   ...
 
   ...
}
+
} >
</code>
+
</nowiki>
    
== Playing the file ==
 
== Playing the file ==
29 917

modifications

Menu de navigation