Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Sorunome

Pages: 1 ... 103 104 [105] 106 107 ... 591
1561
Miscellaneous / Re: Birthday Posts
« on: July 09, 2014, 11:18:14 am »
Happy b-day DJ!
Have a muffin:

1562
News / Re: Reuben Quest: Ev Awakening AXE
« on: July 08, 2014, 12:24:57 pm »
Haha, thanks!
Glad you like it! :)

1563
Computer Programming / Re: pocketsphinx
« on: July 07, 2014, 02:55:25 pm »
Code: [Select]
###!/usr/bin/python2
try:
        import pocketsphinx as ps
except:
        import pocketsphinx as ps

import sphinxbase,pyaudio,wave

hmmd = '/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k'
lmdir = '/usr/local/share/pocketsphinx/model/lm/en_US/wsj0vp.5000.DMP'
dictp = '/usr/local/share/pocketsphinx/model/lm/en_US/cmu07a.dic'

hmmd = '/usr/local/share/pocketsphinx/model/hmm/en/tidigits'
lmdir = '/usr/local/share/pocketsphinx/model/lm/en/tidigits.DMP'
dictp = '/usr/local/share/pocketsphinx/model/lm/en/tidigits.dic'

#lmdir = '/home/sorunome/languagemodel_persona.lm'
#dictp = '/home/sorunome/dictionary_persona.dic'

p = pyaudio.PyAudio()

device = p.get_device_info_by_index(0)


CHUNK = 5750
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = int(device['defaultSampleRate'])

inputStream = p.open(format=FORMAT,channels=CHANNELS,rate=RATE,input=True,output=False,frames_per_buffer=CHUNK)

frames = []
for i in range(RATE/CHUNK * 5):
        frames.append(inputStream.read(CHUNK))

inputStream.stop_stream()
inputStream.close()
p.terminate()
write_frames = wave.open('tmp.wav','wb')
write_frames.setnchannels(CHANNELS)
write_frames.setsampwidth(p.get_sample_size(FORMAT))
write_frames.setframerate(RATE)
write_frames.writeframes(''.join(frames))
write_frames.close()


wavFile = file('tmp.wav','rb')
wavFile.seek(44)
#speechRec =  ps.Decoder(lm='/usr/local/share/pocketsphinx/model/lm/en_US/hub4.5000.DMP',dict='/usr/local/share/pocketsphinx/model/lm/en_US/hub4.5000.dic',hmm='/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k')
#speechRec =  ps.Decoder(lm='/home/sorunome/languagemodel_persona.lm',dict='/home/sorunome/dictionary_persona.dic',hmm='/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k')
speechRec = ps.Decoder(hmm = hmmd,lm = lmdir,dict = dictp)
speechRec.decode_raw(wavFile)
print 'EPIC output',speechRec.get_hyp()
Lol, how did the extra hashes reach the first line of code :P

1564
Axe / Re: Axe Little contest !
« on: July 07, 2014, 02:43:20 pm »
But DATA() puts the bytes just like that in memory, right? and 18 followed by the pointer is jr pointer. Ok, actually you'd need to do like jr 1, because relativness

1565
Axe / Re: Axe Little contest !
« on: July 07, 2014, 02:40:59 pm »
Watch out guys, I found this topic. :P
Lol, I was wondering how long you would let us brag about our programs before appearing :P

Wait, what if, instead of the ASM() command we put the data as hex and jump to that memory address :P
Yeah, but how do you jump to the right memory address ?
jup, goto address or soemthing, or something like DATA(\x18,PTR) (JR)

1566
Axe / Re: Axe Little contest !
« on: July 07, 2014, 02:29:26 pm »
Wait, what if, instead of the ASM() command we put the data as hex and jump to that memory address :P

1567
Computer Programming / Re: pocketsphinx
« on: July 07, 2014, 01:24:53 pm »
Setting it to 16kHz gives me this:

Code: [Select]
Expression 'r' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2018
Expression 'PaAlsaStreamComponent_FinishConfigure( &self->capture, hwParamsCapture, inParams, self->primeBuffers, realSr, inputLatency )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2655
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2767
Traceback (most recent call last):
  File "speechcontrol.py", line 33, in <module>
    inputStream = p.open(format=FORMAT,channels=CHANNELS,rate=RATE,input=True,output=False,frames_per_buffer=CHUNK)
  File "/usr/lib/pymodules/python2.7/pyaudio.py", line 714, in open
    stream = Stream(self, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/pyaudio.py", line 396, in __init__
    self._stream = pa.open(**arguments)
IOError: [Errno Unanticipated host error] -9999

And I'm just messing with voice control, I mean how epic would it be if you enter your room and say "ok pi, turn on my computer"

1568
Computer Programming / Re: pocketsphinx
« on: July 07, 2014, 01:16:07 pm »
I don't see any kHz setting, all i see is the RATE setting (which I already use here :) )
EDIT: setting RATE caches the recording :( But On playback it tells me it is 44100Hz rate, which is what i set the RATE variable to.

1569
Computer Programming / Re: pocketsphinx
« on: July 07, 2014, 01:00:29 pm »
How can i set how many kHz I want to record, using pyaudio?

1570
Miscellaneous / Re: My Little Pony: Friendship is Magic
« on: July 07, 2014, 12:25:48 pm »
Same here, also I wonder which of the two guys is Playerdotexe? :P
The one rightmost :P

1571
Miscellaneous / Re: My Little Pony: Friendship is Magic
« on: July 07, 2014, 08:34:08 am »
tl;dw. I can see a you, though :D Also, can't wait for july 12th :3
pretty much sums it up :P

1572
Grammer / Re: Grammer
« on: July 06, 2014, 05:02:48 pm »
You can get it here: http://www.omnimaga.org/grammer/latest-grammer-updates/msg299276/#msg299276
I think there is a command list etc in the archive.

1573
TI Z80 / Re: [Axe] Link Port Pong
« on: July 05, 2014, 02:01:10 am »
Ah, this is looking awesome! :D

1574
Computer Programming / pocketsphinx
« on: July 04, 2014, 11:08:58 am »
Anyone with pocketsphinx experience here?
The thing is that it only recognizes jibberish for me :(

1575
Humour and Jokes / Re: Weird/funny pictures thread
« on: July 04, 2014, 12:14:48 am »
non-Disney words O.O

Pages: 1 ... 103 104 [105] 106 107 ... 591