File: voicekey.rst

package info (click to toggle)
psychopy 2020.2.10%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 44,056 kB
  • sloc: python: 119,649; javascript: 3,022; makefile: 148; sh: 125; xml: 9
file content (70 lines) | stat: -rw-r--r-- 2,198 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.. _voicekey:

:mod:`psychopy.voicekey` - Real-time sound processing
======================================================

(Available as of version 1.83.00)

Overview
--------
Hardware voice-keys are used to detect and signal acoustic properties in real
time, e.g., the onset of a spoken word in word-naming studies. PsychoPy
provides two virtual voice-keys, one for detecting vocal onsets and one for vocal
offsets.

All PsychoPy voice-keys can take their input from a file or from a microphone.
Event detection is typically quite similar is both cases.

The base class is very general, and is best thought of as providing a toolkit
for developing a wide range of custom voice-keys. It would be possible to develop
a set of voice-keys, each optimized for detecting different initial phonemes.
Band-pass filtered data and zero-crossing counts are computed in real-time
every 2ms.

Voice-Keys
-------------

.. autoclass:: psychopy.voicekey.OnsetVoiceKey
    :members:
    :exclude-members: trip
    :inherited-members:

.. autoclass:: psychopy.voicekey.OffsetVoiceKey

Signal-processing functions
----------------------------

Several utility functions are available for real-time sound analysis.

.. autofunction:: psychopy.voicekey.smooth

.. autofunction:: psychopy.voicekey.bandpass

.. autofunction:: psychopy.voicekey.rms

.. autofunction:: psychopy.voicekey.std

.. autofunction:: psychopy.voicekey.zero_crossings

.. autofunction:: psychopy.voicekey.tone

.. autofunction:: psychopy.voicekey.apodize

Sound file I/O
---------------
Several helper functions are available for converting and saving sound data
from several data formats (numpy arrays, pyo tables) and file formats. All file formats that
`pyo` supports are available, including `wav`, `flac` for lossless compression. `mp3` format is not
supported (but you can convert to .wav using another utility).

.. autofunction:: psychopy.voicekey.samples_from_table

.. autofunction:: psychopy.voicekey.table_from_samples

.. autofunction:: psychopy.voicekey.table_from_file

.. autofunction:: psychopy.voicekey.samples_from_file

.. autofunction:: psychopy.voicekey.samples_to_file

.. autofunction:: psychopy.voicekey.table_to_file