Skip to content

Commit

Permalink
Fixed print functions in recognition.py for python 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
fakufaku committed Jun 14, 2016
1 parent 81ed143 commit 3703e10
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pyroomacoustics/recognition.py
@@ -1,5 +1,5 @@

from __future__ import division
from __future__ import division, print_function

import numpy as np
import os
Expand Down Expand Up @@ -301,14 +301,14 @@ def fit(self, examples, tol=0.1, max_iter=10, init_func=None):
#--------------------------
n_iter += 1
epsilon = loglikelihood - loglikelihood_old
print 'Iterations:', n_iter, 'epsilon:', epsilon, 'LL_new:', loglikelihood
print('Iterations:', n_iter, 'epsilon:', epsilon, 'LL_new:', loglikelihood)

# some checks here
if epsilon < tol:
print 'Tolerance reached: stopping.'
print('Tolerance reached: stopping.')
break
if n_iter == max_iter:
print 'Maximum iterations reached: stopping.'
print('Maximum iterations reached: stopping.')
break

loglikelihood_old = loglikelihood
Expand Down Expand Up @@ -435,7 +435,7 @@ def play(self):
if have_sk_audiolab and have_sk_samplerate:
play(np.array(resample(self.samples, 44100./self.fs, 'sinc_best'), dtype=np.float64))
else:
print 'Warning: scikits.audiolab and scikits.samplerate are required to play audiofiles.'
print('Warning: scikits.audiolab and scikits.samplerate are required to play audiofiles.')

def mfcc(self, frame_length=1024, hop=512):
''' compute the mel-frequency cepstrum coefficients of the word samples '''
Expand Down Expand Up @@ -553,7 +553,7 @@ def play(self):
if have_sk_audiolab and have_sk_samplerate:
play(np.array(resample(self.data, 44100./self.fs, 'sinc_best'), dtype=np.float64))
else:
print 'Warning: scikits.audiolab and scikits.samplerate are required to play audiofiles.'
print('Warning: scikits.audiolab and scikits.samplerate are required to play audiofiles.')

def plot(self, L=512, hop=128, zpb=0, phonems=False, **kwargs):

Expand Down

0 comments on commit 3703e10

Please sign in to comment.