We're generating single-channel sounds. Tell oggenc that
authorStefano Rivera <stefano@rivera.za.net>
Sat, 17 May 2014 14:34:25 +0000 (16:34 +0200)
committerStefano Rivera <stefano@rivera.za.net>
Sat, 17 May 2014 14:34:25 +0000 (16:34 +0200)
14 files changed:
data/sounds/__init__.py
data/sounds/aha.ogg
data/sounds/awwww.ogg
data/sounds/chirp.ogg
data/sounds/error.ogg
data/sounds/grind.ogg
data/sounds/shutdown.ogg
data/sounds/silence.ogg
data/sounds/startup.ogg
data/sounds/yipee.ogg
data/sounds/zoop.ogg
data/sounds/zzzzz.ogg
naja/gen_sound.py
tools/gen_sound.py

index 48f3e203dfafdf8af65ce077e16dd2df89dd128c..5773cb3970515c5763472e2143228cdb095ec46f 100644 (file)
@@ -5,34 +5,34 @@ from naja.gen_sound import Chunk, scale
 
 
 def grind():
-    yield Chunk('sine', freq=100, length=0.01, volume=25)
+    yield Chunk('sine', freq=200, length=0.01, volume=25)
     tones = []
-    for freq in (100, 150, 200, 350, 120, 170, 300):
-        tones.append(Chunk('sine', freq=freq, length=0.01, volume=25))
+    for freq in (200, 300, 400, 700, 240, 340, 600):
+        tones.append(Chunk('sine', freq=freq, length=0.005, volume=25))
     for i in range(75):
         yield random.choice(tones)
-    yield Chunk('sine', freq=100, length=0.01, volume=25)
+    yield Chunk('sine', freq=200, length=0.01, volume=25)
 
 
 SOUNDS = {
     'chirp': scale(1650, 1449, -200, length=0.05, volume=50),
     'error': Chunk('sine', freq=1000, length=0.25),
     'grind': grind(),
-    'shutdown': scale(800, 199, -200),
+    'shutdown': scale(1600, 399, -400, length=0.1),
     'silence': Chunk('silence', length=2),
-    'startup': scale(200, 801, 200),
-    'zoop': scale(500, 800, 20, length=0.01, volume=50),
-    'zzzzz': Chunk('sine', freq=100, length=0.5, volume=50),
+    'startup': scale(400, 1601, 400, length=0.1),
+    'zoop': scale(1000, 1600, 40, length=0.005, volume=50),
+    'zzzzz': Chunk('sine', freq=200, length=0.25, volume=50),
     'yipee': itertools.chain(
-        scale(800, 1001, 50, length=0.1, volume=50),
-        scale(900, 1001, 50, length=0.1, volume=50),
+        scale(1400, 1801, 100, length=0.05, volume=50),
+        scale(1600, 1801, 100, length=0.05, volume=50),
     ),
     'awwww': (
-        Chunk('sine', freq=400, volume=50),
-        Chunk('sine', freq=250, length=0.5, volume=50),
+        Chunk('sine', freq=800, length=0.1, volume=50),
+        Chunk('sine', freq=500, length=0.2, volume=50),
     ),
     'aha': (
-        Chunk('sine', freq=1100, length=0.2, volume=50),
-        Chunk('sine', freq=1200, length=0.1, volume=50),
+        Chunk('sine', freq=2000, length=0.1, volume=50),
+        Chunk('sine', freq=2200, length=0.05, volume=50),
     ),
 }
index 84b3d0b472fb5fd7e910c3a1ba62f9df61abd76c..49589e08c097c28f82f80cb786fb3bcc80ce9eed 100644 (file)
Binary files a/data/sounds/aha.ogg and b/data/sounds/aha.ogg differ
index 7e91d97b2ecaf4f1e077c2418dc9c0789e4bdd37..2ab41d972dd6732bd033ad9fa0d58729193f23cc 100644 (file)
Binary files a/data/sounds/awwww.ogg and b/data/sounds/awwww.ogg differ
index da5ef18a5f52eda40d8ca8e15834bb3e976ad3ee..249d00417c4aedf07599fa7ce130eab7ba9a98e3 100644 (file)
Binary files a/data/sounds/chirp.ogg and b/data/sounds/chirp.ogg differ
index ac62c6bdd36d4f335520a87e3a1bcf3f4206812a..32004281da2fe138a6685b71fb649b0a01d48391 100644 (file)
Binary files a/data/sounds/error.ogg and b/data/sounds/error.ogg differ
index 7fc162686b28df2a2745a000f3694a2f30fec961..800e7b50b08713894dba64f6091353065e619111 100644 (file)
Binary files a/data/sounds/grind.ogg and b/data/sounds/grind.ogg differ
index c7048900120a16c8878ef7477a68d37d3915a240..6bd99a868da6fb854983881a60fd065363a4644c 100644 (file)
Binary files a/data/sounds/shutdown.ogg and b/data/sounds/shutdown.ogg differ
index 967551903598c9f53dbf8764394fba9394b991d3..93bfcc8ae29cc9d6fe8b586e43ec8d434dd94a03 100644 (file)
Binary files a/data/sounds/silence.ogg and b/data/sounds/silence.ogg differ
index ad2f39b0d1aa757daec45d53457bf9976f892c63..0a4ca4f1baab4f0db21e5c35062b70132c51daa6 100644 (file)
Binary files a/data/sounds/startup.ogg and b/data/sounds/startup.ogg differ
index 4e2c4f2df82d4e16195db315a0810591d35694b4..d4930a7e7bd5a57b12ed9c67fe5378a917573038 100644 (file)
Binary files a/data/sounds/yipee.ogg and b/data/sounds/yipee.ogg differ
index bee8aeb41679cc60e9868b0ca984e082fea40e10..eb28c59c90521dfc1290868e52fe91035ed30c26 100644 (file)
Binary files a/data/sounds/zoop.ogg and b/data/sounds/zoop.ogg differ
index 2a185c1494d4ec8d64c4a2a233d8282a6a76372a..cf61dc8e8f32b1ee50bb3d6ec98e92bc2788c1eb 100644 (file)
Binary files a/data/sounds/zzzzz.ogg and b/data/sounds/zzzzz.ogg differ
index 8ad04795ec0036d37c4e9e9080a53d5112b5fdd0..f324c8c7212ce6bfeecd36781bbbe84c4971c071 100644 (file)
@@ -36,7 +36,7 @@ class Chunk(object):
 
     def raw(self):
         if self.type == 'silence':
-            for i in xrange(int(176400 * self.length)):
+            for i in xrange(int(88200 * self.length)):
                 yield '\x00'
 
         if self.type == 'sine':
index a85211961824401572aa98a4dd897f1d1c3501c9..94bf3d12cd59d7891ece2dc2674a901737eaf982 100755 (executable)
@@ -13,7 +13,8 @@ def gen_raw(description):
 
 def encode(filename, data):
     print "Writing %s" % filename
-    p = Popen(('oggenc', '-o', filename, '--raw', '--quiet', '-'),
+    p = Popen(('oggenc', '-o', filename, '--raw', '--raw-chan=1',
+               '--quiet', '-'),
               stdin=PIPE, cwd='data/sounds')
     for blob in data:
         p.stdin.write(blob)