VLSI Solution Oy VS1103 VLSI Solution Karaoke, MIDI and ADPCM Player Source Code Documentation

Main Page | Class List | File List | Class Members | File Members | Related Pages

record.c

Go to the documentation of this file.
00001 
00003 #include "record.h"
00004 #include "filesys.h"
00005 #include "storage.h"
00006 #include "vs10xx.h"
00007 #include "console.h"
00008 #include "ui.h"
00009 #include "display.h"
00010 
00011 
00012 extern xdata unsigned char SPMax;
00013 
00015 code const unsigned char RIFFHeader0[] = {
00016   'R' , 'I' , 'F' , 'F' , // Chunk ID (RIFF)
00017   0x70, 0x70, 0x70, 0x70, // Chunk payload size (calculate after rec!)
00018   'W' , 'A' , 'V' , 'E' , // RIFF resource format type
00019   
00020   'f' , 'm' , 't' , ' ' , // Chunk ID (fmt )
00021   0x14, 0x00, 0x00, 0x00, // Chunk payload size (0x14 = 20 bytes)
00022   0x11, 0x00,             // Format Tag (IMA ADPCM)
00023   0x01, 0x00,             // Channels (1)
00024   0x44, 0xac, 0x00, 0x00, // Sample Rate, 0x3e80 = 16.0kHz 1f40=8kHz 2580=9600 ac44=44.1
00025   0xd7, 0x0f, 0x00, 0x00, // Average Bytes Per Second
00026   0x00, 0x01,             // Data Block Size (256 bytes) 
00027   0x04, 0x00,             // ADPCM encoded bits per sample (4 bits)
00028   0x02, 0x00,             // Extra data (2 bytes)
00029   0xf9, 0x01,             // Samples per Block (505 samples)
00030   
00031   'f' , 'a' , 'c' , 't' , // Chunk ID (fact)
00032   0xc8, 0x01, 0x00, 0x00, // Chunk payload size (456 bytes (zeropad!))
00033   0xff, 0xff, 0xff, 0xff  // Number of Samples (calculate after rec!)
00034   // Insert 448 zeroes here!
00035 };
00036 
00038 code const unsigned char RIFFHeader504[] = {
00039   'd' , 'a' , 't' , 'a' , // Chunk ID (data)
00040   0x70, 0x70, 0x70, 0x70  // Chunk payload size (calculate after rec!)
00041 };
00042 
00043 
00045 code const unsigned char RIFFHeader9k6Hz[] = {
00046   'R' , 'I' , 'F' , 'F' , // Chunk ID (RIFF)
00047   0x70, 0x70, 0x70, 0x70, // Chunk payload size (calculate after rec!)
00048   'W' , 'A' , 'V' , 'E' , // RIFF resource format type
00049   
00050   'f' , 'm' , 't' , ' ' , // Chunk ID (fmt )
00051   0x14, 0x00, 0x00, 0x00, // Chunk payload size (0x14 = 20 bytes)
00052   0x11, 0x00,             // Format Tag (IMA ADPCM)
00053   0x01, 0x00,             // Channels (1)
00054   0x80, 0x25, 0x00, 0x00, // Sample Rate 9600 Hz. (14.7456 xtal)
00055   0xd7, 0x0f, 0x00, 0x00, // Average Bytes Per Second
00056   0x00, 0x01,             // Data Block Size (256 bytes) 
00057   0x04, 0x00,             // ADPCM encoded bits per sample (4 bits)
00058   0x02, 0x00,             // Extra data (2 bytes)
00059   0xf9, 0x01,             // Samples per Block (505 samples)
00060   
00061   'f' , 'a' , 'c' , 't' , // Chunk ID (fact)
00062   0xc8, 0x01, 0x00, 0x00, // Chunk payload size (456 bytes (zeropad!))
00063   0xff, 0xff, 0xff, 0xff  // Number of Samples (calculate after rec!)
00064   // Insert 448 zeroes here!
00065 };
00066 
00067 
00068 
00069 

All software copyright 2000-2004 VLSI Solution OY. Redistribution of these software modules is limited to VLSI Solution Oy chip promotional use only. Free or commercial use of these software modules in MP3 players is ok if the product includes chip(s) from VLSI. You can request the complete (compilable) package from mp3@vlsi.fi. This exampe code is provided with good faith to assist You in code development, but under no circumstances will VLSI offer any guarantees on the usability or functionality of any example software or its fitness for any purpose.