Skip to content

Instantly share code, notes, and snippets.

@alex-laties
Created January 20, 2012 22:19
Show Gist options
  • Save alex-laties/1649926 to your computer and use it in GitHub Desktop.
Save alex-laties/1649926 to your computer and use it in GitHub Desktop.
implementation
//
// SoundAnalyzer.cpp
// BadTouchCLI
//
// Created by Alex Laties on 1/20/12.
// Copyright (c) 2012 University of Pennsylvania. All rights reserved.
//
#include "SoundAnalyzer.h"
void SoundAnalyzer::ProcessPacket(<#AudioQueueBufferRef buf#>) {
//TODO something
}
SoundAnalyzer::SoundAnalyzer(){
position = 0;
last_peak = 0;
num_peaks = 0;
max_amplitude = 0.;
time_since_last = 0.;
clip_length = 0.;
}
//
// SoundAnalyzer.h
// BadTouchCLI
//
// Created by Alex Laties on 1/20/12.
// Copyright (c) 2012 University of Pennsylvania. All rights reserved.
//
#ifndef BadTouchCLI_SoundAnalyzer_h
#define BadTouchCLI_SoundAnalyzer_h
#include <AudioToolbox/AudioToolbox.h>
#include <stdio.h>
#include <stdlib.h>
class SoundAnalyzer {
private:
int position;
int last_peak;
int num_peaks;
float max_amplitude;
float time_since_last;
float clip_length;
public:
void ProcessPacket(AudioQueueBufferRef buf);
SoundAnalyzer();
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment