-
Notifications
You must be signed in to change notification settings - Fork 0
/
WavTests.c
93 lines (83 loc) · 1.72 KB
/
WavTests.c
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
90
91
92
93
/*
* WavTests.c
*
* Created on: Mar 13, 2013
* Author: Leslie
*/
#if 0
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "FileStructs.h"
#include "WavOps.h"
#include "interface_SD.h"
#include <altera_up_sd_card_avalon_interface.h>
#include "commander.h"
int main(){
printf("starting \n");
int i;
sd_init();
//Testing WavInit
wavInit();
load_piano();
load_drums();
/*for(i=0;i<2; i++){
play_in_parr(i);
/*printf("The information for the .wav is: \n");
printf("datasize: %d\nchannels: %d\nfilename: %s\nsamplerate: %d\nsamplesize: %d\n",parr[i]->datasize, parr[i]->channels,
parr[i]->filename,parr[i]->samplerate, parr[i]->samplesize);
}*/
//Testing the .wav total retrieval
//printf("Total .wavs present on the sd card is: %d\n\n", getPlayable());
//playSong(parr[0]);
while(1){
int i = 0;
play_in_parr(0);
while(i < 12){
if(numSongs == 0){
i++;
play_in_parr(i);
}
}
i=0;
play_in_darr(0);
while(i < 6){
if(numSongs == 0){
i++;
play_in_darr(i);
}
}
}
printf("done");
//while(1){
/*Testing the readspeed of the SD card
char* testbuffer = malloc (330000*sizeof(char));
short int test = openRead("seph.wav");
int i;
printf("Testing readspeed\n");
for(i=0;i<330000;i++)
testbuffer[i] = alt_up_sd_card_read(test);
printf("done\n");
free(testbuffer);
*/
/*
if(playStart == NULL){
playSong(pianoArr[0]);
printf("Should be playing\n");
}
playArr();
}
*/
//playSongNamed("boing.wav");
//playSongNamed("test.wav");
//playSongNamed("dingding.wav");
/*
//Testing song playback continued - filenames
printf("Now playing named\n");
if(playSongNamed("dingding.wav")!= 0){
printf("This failed horribly\n");
}
*/
return 0;
}
#endif