Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion source/nvwave.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def __init__(self, channels, samplesPerSec, bitsPerSample,
if buffered:
#: Minimum size of the buffer before audio is played.
#: However, this is ignored if an C{onDone} callback is provided to L{feed}.
self._minBufferSize = samplesPerSec * channels * (bitsPerSample / 8) / 1000 * self.MIN_BUFFER_MS
BITS_PER_BYTE = 8
MS_PER_SEC = 1000
self._minBufferSize = samplesPerSec * channels * (bitsPerSample / BITS_PER_BYTE) / MS_PER_SEC * self.MIN_BUFFER_MS
self._buffer = ""
else:
self._minBufferSize = None
Expand Down
6 changes: 3 additions & 3 deletions source/sayAllHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def nextLine(self):
return
# Call lineReached when we start speaking this line.
# lineReached will move the cursor and trigger reading of the next line.
cb = speech.CallbackCommand(lambda: self.lineReached(bookmark, self.speakTextInfoState.copy()))
cb = speech.CallbackCommand(lambda obj=self.reader.obj, state=self.speakTextInfoState.copy(): self.lineReached(obj,bookmark, state))
spoke = speech.speakTextInfo(self.reader, unit=textInfos.UNIT_READINGCHUNK,
reason=controlTypes.REASON_SAYALL, _prefixSpeechCommand=cb,
useCache=self.speakTextInfoState)
Expand All @@ -168,10 +168,10 @@ def nextLine(self):
# The first buffered line has now started speaking.
self.numBufferedLines -= 1

def lineReached(self, bookmark, state):
def lineReached(self, obj, bookmark, state):
# We've just started speaking this line, so move the cursor there.
state.updateObj()
updater = self.reader.obj.makeTextInfo(bookmark)
updater = obj.makeTextInfo(bookmark)
if self.cursor == CURSOR_CARET:
updater.updateCaret()
if self.cursor != CURSOR_CARET or config.conf["reviewCursor"]["followCaret"]:
Expand Down
Loading