add a script to generate test data
This commit is contained in:
		
							parent
							
								
									0dacb730a9
								
							
						
					
					
						commit
						1fc757c6fb
					
				
					 1 changed files with 21 additions and 0 deletions
				
			
		
							
								
								
									
										21
									
								
								generate-test-data.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								generate-test-data.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
from datetime import datetime, timedelta
 | 
			
		||||
 | 
			
		||||
KBITS = 128
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bytes_per_second = KBITS * 1024 // 8
 | 
			
		||||
 | 
			
		||||
start = datetime.now().replace(minute=0, second=0) - timedelta(hours=3)
 | 
			
		||||
end = start + timedelta(hours=6)
 | 
			
		||||
delta = timedelta(hours=1)
 | 
			
		||||
 | 
			
		||||
t = start
 | 
			
		||||
while t < end:
 | 
			
		||||
    fn = 'tmp/qfhi-{:04d}{:02d}{:02d}-{:02d}{:02d}.mp3'.format(
 | 
			
		||||
            t.year, t.month, t.day, t.hour, t.minute)
 | 
			
		||||
    print(fn)
 | 
			
		||||
    f = open(fn, 'w')
 | 
			
		||||
    f.write('\0' * (int(delta.total_seconds()) * bytes_per_second))
 | 
			
		||||
    f.close()
 | 
			
		||||
 | 
			
		||||
    t += delta
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue