temp
This commit is contained in:
		
							
								
								
									
										2
									
								
								demos/test-convert/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								demos/test-convert/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
files/*
 | 
			
		||||
!files/test.pcm
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								demos/test-convert/files/test.pcm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								demos/test-convert/files/test.pcm
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										12
									
								
								demos/test-convert/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								demos/test-convert/index.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
import { encodeWav, decodeWav } from '../../src/wav-converter';
 | 
			
		||||
import fs from 'fs';
 | 
			
		||||
const pcm = fs.readFileSync('./files/test.pcm');
 | 
			
		||||
 | 
			
		||||
const wav = encodeWav(pcm, {
 | 
			
		||||
  sampleRate: 16000,
 | 
			
		||||
  numChannels: 1,
 | 
			
		||||
  byteRate: 16,
 | 
			
		||||
});
 | 
			
		||||
console.log(wav);
 | 
			
		||||
 | 
			
		||||
fs.writeFileSync('./files/test.wav', wav);
 | 
			
		||||
		Reference in New Issue
	
	Block a user