| | |
RE: reading .wav file and putting ito inot the array
![]() |
•
•
Join Date: Apr 2006
Posts: 2
Reputation:
Solved Threads: 0
please help I want to reading .wav file and putting ito inot the array to do some manipulations.... here is the bit of the code, I am trying to read the file called yes1.wav and putting it into the array and it returining junk...sometime cannot open the fp1 = fopen( argv[1], "rb" ) or cannot open it at all
C Syntax (Toggle Plain Text)
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; int *speechyes; void main(char argc, char *argv[] ) { FILE *fp1,*fp3; //if ( argc != 3 ) //{ // printf("differ fileone filetwo\n"); // exit(0); //} fp3 = fopen("yes1.wav","w"); //fp1 = fopen( argv[1], "rb" ); if(!fp1 ) { printf("Error opening file %s \n"); } int k=0; speechyes = new int[50000]; while(fread(&speechyes[k],2,1,fp3)==2) { k++; } cout<<k<<endl; for(int i=0;i<5;i++) { cout<<speechyes[i]<<endl; } }
Last edited by Dave Sinkula; Apr 23rd, 2006 at 5:36 pm.
![]() |
Similar Threads
- help executing a .wav file with php code (PHP)
- Play a .wav file (Java)
- Reading txt file into Hash Table (C++)
- Reading an input file as a class memeber function (C++)
- wav file problem (Visual Basic 4 / 5 / 6)
- reading txt file into array (C++)
- Not reading in entire file. (C++)
Other Threads in the C Forum
- Previous Thread: Read Me : Always mark the thread solved when the problem is solved
- Next Thread: Basic arithemetic on rational numbers
| Thread Tools | Search this Thread |
* adobe ansi api array arrays binarysearch calculate centimeter char character cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hacking highest homework i/o inches incrementoperators intmain() iso km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. lowest match matrix microsoft mqqueue mysql oddnumber odf open opendocumentformat openwebfoundation pattern pdf performance posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string suggestions test unix urboc user variable voidmain() whythiscodecausesegmentationfault win32api windows.h windowsapi





