File: test_wav.prg

package info (click to toggle)
fenix-plugins 0.0.20070803-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 36,452 kB
  • sloc: sh: 8,736; ansic: 3,026; xml: 413; makefile: 221
file content (89 lines) | stat: -rw-r--r-- 1,983 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
PROGRAM test;


IMPORT "mixer.dll"

GLOBAL

fichero;
fichero2;
canal;
playing;

float volumen=1.0;
float frecuencia=44100;


private


begin
     SOUND_MODE=1;
     SOUND_FREQ=44100;
     frame;
     frame;
     frame;

     mixer_init();
     
     fichero=mixer_load_wav("game.wav");
     //fichero=mixer_load_wav("arabe.ogg");
     //fichero=mixer_load_wav("ff5title.it");

     canal=mixer_play_wav(fichero);

     write_int (0,0,0,0,&playing);

     repeat
        playing=mixer_is_playing_wav(canal);
        if (key(_1)) 
                mixer_play_wav(fichero2);
                repeat frame; until (key(_1)==false);
        end;
        if (key(_q))
                volumen=volumen-0.1;
                mixer_set_wav_volume(canal,volumen);
                repeat frame; until (key(_q)==false);
        end;
        if (key(_w))
                volumen=volumen+0.1;
                mixer_set_wav_volume(canal,volumen);
                repeat frame; until (key(_w)==false);
        end;
        if (key(_z))
                frecuencia=frecuencia-100;
                mixer_set_wav_freq(canal,frecuencia);
                
        end;
        if (key(_x))
                frecuencia=frecuencia+100;
                mixer_set_wav_freq(canal,frecuencia);
                
        end;

        if (key(_u))
                mixer_unload_wav(fichero2);
                repeat frame; until (key(_u)==false);
        end;
        if (key(_p))
                mixer_pause_wav(canal);
                repeat frame; until (key(_p)==false);
        end;
        if (key(_r))
                mixer_resume_wav(canal);
                repeat frame; until (key(_r)==false);
        end;
        if (key(_s))
                mixer_stop_wav(canal);
                repeat frame; until (key(_s)==false);
        end;
        if (key(_m))
                mixer_rewind_wav(canal);
                repeat frame; until (key(_m)==false);
        end;


        frame;
     until (key(_esc));

end;