source: trunk/third/audiofile/test/loop.c @ 17099

Revision 17099, 1.1 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r17098, which included commits to RCS files with non-trunk default branches.
Line 
1#include <audiofile.h>
2
3int main (int argc, char **argv)
4{
5        AFfilehandle    file;
6        AFfilesetup     setup;
7        int             markerIDs[] = {1, 2, 3, 4};
8        int             loopIDs[] = {1, 2};
9        short           frames[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
10
11        setup = afNewFileSetup();
12        afInitFileFormat(setup, AF_FILE_AIFF);
13
14        afInitMarkIDs(setup, AF_DEFAULT_TRACK, markerIDs, 4);
15        afInitMarkName(setup, AF_DEFAULT_TRACK, 1, "sustain loop start");
16        afInitMarkName(setup, AF_DEFAULT_TRACK, 2, "sustain loop end");
17        afInitMarkName(setup, AF_DEFAULT_TRACK, 3, "release loop start");
18        afInitMarkName(setup, AF_DEFAULT_TRACK, 4, "release loop end");
19
20        afInitLoopIDs(setup, AF_DEFAULT_INST, loopIDs, 2);
21
22        file = afOpenFile(argv[1], "w", setup);
23
24        afWriteFrames(file, AF_DEFAULT_TRACK, frames, 5);
25
26        afSetMarkPosition(file, AF_DEFAULT_TRACK, 1, 0);
27        afSetMarkPosition(file, AF_DEFAULT_TRACK, 2, 2);
28        afSetMarkPosition(file, AF_DEFAULT_TRACK, 3, 4);
29        afSetMarkPosition(file, AF_DEFAULT_TRACK, 4, 5);
30
31        afSetLoopStart(file, AF_DEFAULT_INST, 1, 1);
32        afSetLoopEnd(file, AF_DEFAULT_INST, 1, 2);
33        afSetLoopStart(file, AF_DEFAULT_INST, 2, 3);
34        afSetLoopEnd(file, AF_DEFAULT_INST, 2, 4);
35
36        afCloseFile(file);
37}
Note: See TracBrowser for help on using the repository browser.