RE: reading .wav file and putting ito inot the array

Reply

Join Date: Apr 2006
Posts: 2
Reputation: neo2nate is an unknown quantity at this point 
Solved Threads: 0
neo2nate neo2nate is offline Offline
Newbie Poster

RE: reading .wav file and putting ito inot the array

 
0
  #1
Apr 22nd, 2006
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

  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string.h>
  4. using namespace std;
  5.  
  6.  
  7. int *speechyes;
  8.  
  9.  
  10. void main(char argc, char *argv[] )
  11. {
  12. FILE *fp1,*fp3;
  13.  
  14. //if ( argc != 3 )
  15. //{
  16. // printf("differ fileone filetwo\n");
  17. // exit(0);
  18. //}
  19. fp3 = fopen("yes1.wav","w");
  20.  
  21. //fp1 = fopen( argv[1], "rb" );
  22. if(!fp1 )
  23. {
  24. printf("Error opening file %s \n");
  25. }
  26. int k=0;
  27. speechyes = new int[50000];
  28.  
  29. while(fread(&speechyes[k],2,1,fp3)==2)
  30. {
  31. k++;
  32. }
  33.  
  34. cout<<k<<endl;
  35. for(int i=0;i<5;i++)
  36. {
  37.  
  38. cout<<speechyes[i]<<endl;
  39.  
  40. }
  41. }
Last edited by Dave Sinkula; Apr 23rd, 2006 at 5:36 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: blue noah is an unknown quantity at this point 
Solved Threads: 0
blue noah blue noah is offline Offline
Newbie Poster
 
0
  #2
26 Days Ago
plz i have a project to convert wav to arrray in visual basic code can you help me please?
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 27
Reputation: ankur_ is an unknown quantity at this point 
Solved Threads: 2
ankur_ ankur_ is offline Offline
Light Poster
 
0
  #3
26 Days Ago
If you want to play a .wav file you can use mfc program in vc++
to do so
Make a project in mfc and use some of there API's like
sndPlaySound or PlaySound
The same you can put in an array if you want
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC