7

私は何かを作ろうとしています、私は音を録音していて、音(ピッチ、周波数、わからない)に基づいて画像が動くはずです。

私は記録を達成することができます、また私は画像シーケンスをその場で、しかし別々に. それをリンクする方法がわかりません。参考までに、マウスムーバーアプリのようなものを達成しようとしています: アプリのURLはこちら

私の質問は、音の周波数に基づいて画像を移動/アニメーション化するにはどうすればよいですか。

ありがとう

4

2 に答える 2

5

私は解決策を使い果たしました。ディラックを使用して問題を解決しました。

編集:

それは何ですか?

DiracAudioPlayer は、便利な方法で Dirac 機能全体をラップし、AVAudioPlayer が提供するものと同様の API を公開する Cocoa クラスの新しいセットです。これは AVAudioPlayer サブクラスではないことに注意してください。以下は、コア機能と API の説明です。

DiracAudioPlayer のコア機能

DiracAudioPlayer は、リアルタイムでオーディオ ファイルの速度とピッチを同時に変更しながら、さまざまなオーディオ フォーマット (MPMediaItems を含む) のファイル ベースの再生を可能にする一連のクラスです。バージョン 3.6 は、DiracAudioPlayerBase (ファイル IO と再生を処理する基本クラス)、DiracAudioPlayer (Dirac コア API をラップする)、および DiracFxAudioPlayer (DiracFx API をラップする) で構成されます。

プロジェクトに 3 つのクラスすべてと "ExtAudioFile" および "util" フォルダーが含まれていることを確認し、Accelerate.framework と CoreAudio.framework をプロジェクトに追加します。MacOS X では AudioUnit.framework も追加する必要があります。iOS では代わりに AudioToolbox.framework、AVFoundation.framework、MediaPlayer.framework、CoreMedia.framework を追加する必要があります。

DiracAudioPlayer は…</p>

…iOS (バージョン 4 以降) と MacOS X (バージョン 10.6 以降) の両方で動作するタイム ストレッチ オーディオを再生するための Apple 互換クラス …非常に使いやすい …完全な ARC 互換 …完全なソース コードを含めて提供

DiracAudioPlayer API

2012 年 11 月にリリースされたバージョン 3.6 では、次の呼び出しが提供されます。

- (id) initWithContentsOfURL:(NSURL*)inUrl channels:(int)channels error: (NSError **)error;

Initializes and returns an audio player for playing a designated sound file. A URL identifying the sound file to play. The audio data must be in a format supported by Core Audio. Pass in the address of a nil-initialized NSError object. If an error occurs, upon return the NSError object describes the error. To use an item from the user's iPod library supply the URL that you get via MPMediaItem's MPMediaItemPropertyAssetURL property as inUrl. Note that FairPlay protected content can NOT be processed.


- (void) setDelegate:(id)delegate;
- (id) delegate;

クラスのデリゲートを設定/取得します。デリゲート プロトコルを実装する場合、DiracAudioPlayer は実装を呼び出します

- (void)diracPlayerDidFinishPlaying:(DiracAudioPlayerBase *)player successfully:(BOOL)flag

遊び終わったら

- (void) changeDuration:(float)duration;
- (void) changePitch:(float)pitch;

再生速度とピッチを変更する

- (NSInteger) numberOfLoops;
- (void) setNumberOfLoops:(NSInteger)loops;

A value of 0, which is the default, means to play the sound once. Set a positive integer value to specify the number of times to return to the start and play again. For example, specifying a value of 1 results in a total of two plays of the sound. Set any negative integer value to loop the sound indefinitely until you call the stop method.

- (void) updateMeters;

内部測定値を更新するには、-peakPowerForChannel を呼び出す前に呼び出す必要があります。

- (float) peakPowerForChannel:(NSUInteger)channelNumber;

A floating-point representation, in decibels, of a given audio channel’s current peak power. A return value of 0 dB indicates full scale, or maximum power; a return value of -160 dB indicates minimum power (that is, near silence). If the signal provided to the audio player exceeds ±full scale, then the return value may exceed 0 (that is, it may enter the positive range). To obtain a current peak power value, you must call the updateMeters method before calling this method.


- (BOOL) prepareToPlay;

Starts the Dirac processing thread and prepares the sound file for playback. If you don't call this explicitly it will be called when calling -play


- (NSUInteger) numberOfChannels;

オーディオ プレーヤーに関連付けられているサウンドのオーディオ チャネルの数。(読み取り専用)

- (NSTimeInterval) fileDuration;

オーディオ プレーヤーに関連付けられているサウンドの合計継続時間を秒単位で返します。(読み取り専用)

- (NSTimeInterval) currentTime;
- (void) setCurrentTime:(NSTimeInterval)time

Returns the current play time in the input file. Note that if you apply time stretching, -currentTime will reflect the slowed down time depending on the time stretch factor. 

IMPORTANT CHANGE: In previous versions this value returned the total play time independent of the position in the file. Please update your code accordingly to reflect the change

Setting this property causes playback to fast forward or rewind to the specified play time.


- (void) play;

Plays a sound asynchronously. Returns YES on success, or NO on failure. Calling this method implicitly calls the -prepareToPlay method if the audio player is not already prepared to play.

- (NSURL*) url;

オーディオ プレーヤーに関連付けられているサウンドの URL。(読み取り専用)

- (void) setVolume:(float)volume;
- (float) volume;

0.0 ~ 1.0 のオーディオ プレーヤーの再生ゲイン。

- (BOOL) playing;

A Boolean value that indicates whether the audio player is playing (YES) or not (NO). (read-only). To find out when playback has stopped, use the diracPlayerDidFinishPlaying:successfully: delegate method.

- (void) pause;

Pauses playback; sound remains ready to resume playback from where it left off. Calling pause leaves the audio player prepared to play; it does not release the audio hardware that was acquired upon calling -play or -prepareToPlay.

- (void) stop;

Stops playback and undoes the setup needed for playback. Calling this method, or allowing a sound to finish playing, undoes the setup performed upon calling the -play or -prepareToPlay methods.
于 2013-03-15T05:11:14.690 に答える
1

ほとんどのテキスト読み上げシステムでは、作成中の音素 (平たく言えば音) を送信するコールバック関数を登録できます。次のリンクを見てください。左側のコールバックをクリックします。SpeechPhonemeProcPtr を見下ろして、発生するノイズが「uh」、「th」、「ah」、またはその他のノイズである場合に呼び出される関数を登録できるようにします。次に、その特定の音を出すときに人の口がどのように見えるかをイメージして更新します。これは、IBM の ViaVoice では非常に簡単でした。iPhone でそのようなアプリケーションをコーディングしたことはありませんが、オーディオを一致させるよりも優れていると思います。

一致させようとしているのが本当にフィルター処理されていない音声である場合は、それを音声認識システムに渡し、認識されたテキストを TTS システムに渡し、音素を取得できます。

于 2013-03-09T06:32:50.483 に答える