Mercurial > hg > multitrack-audio-matcher
comparison src/AudioEventMatcher.cpp @ 22:24c413f0f2c5
rescue mechanism added
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Sun, 12 Feb 2012 22:25:14 +0000 |
parents | 604add81822f |
children | bc113cd60a2f |
comparison
equal
deleted
inserted
replaced
21:604add81822f | 22:24c413f0f2c5 |
---|---|
147 | 147 |
148 | 148 |
149 void AudioEventMatcher::setSpeedRatioDistribution(const double& speedRatio){ | 149 void AudioEventMatcher::setSpeedRatioDistribution(const double& speedRatio){ |
150 bayesianStruct.relativeSpeedPosterior.zero(); | 150 bayesianStruct.relativeSpeedPosterior.zero(); |
151 bayesianStruct.relativeSpeedPosterior.addToIndex(bayesianStruct.relativeSpeedPosterior.getRealTermsAsIndex(speedRatio), 1); | 151 bayesianStruct.relativeSpeedPosterior.addToIndex(bayesianStruct.relativeSpeedPosterior.getRealTermsAsIndex(speedRatio), 1); |
152 bayesianStruct.relativeSpeedPosterior.addGaussianShapeFromRealTime(1, 0.06, 0.5); | 152 bayesianStruct.relativeSpeedPosterior.addGaussianShapeFromRealTime(1, 0.06, 0.8); |
153 } | 153 } |
154 | 154 |
155 void AudioEventMatcher::stopPlaying(){ | 155 void AudioEventMatcher::stopPlaying(){ |
156 startedPlaying = false; | 156 startedPlaying = false; |
157 temporal.printEventTimes(); | 157 temporal.printEventTimes(); |
158 } | |
159 | |
160 void AudioEventMatcher::rescue(){ | |
161 bayesianStruct.posterior.zero(); | |
162 bayesianStruct.posterior.addConstant(1); | |
163 bayesianStruct.prior.zero(); | |
164 bayesianStruct.prior.addConstant(1); | |
158 } | 165 } |
159 | 166 |
160 void AudioEventMatcher::updatePosition(){ | 167 void AudioEventMatcher::updatePosition(){ |
161 | 168 |
162 if (startedPlaying){ | 169 if (startedPlaying){ |