Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

sox audio editor settings for companding voice

I used the following sox audio editor settings to do dynamic compression on voice.

sox in.wav out.wav lowpass 4000 compand 0.1,0.3 -60,-60,-30,-15,-20,-12,-4,-8,-2,-7 -2

Calculate a NSView's frame in QuickDraw coordinates

@interface NSView (frameAsQuickDrawRect)
- (Rect)frameAsQuickDrawRect;
@end
@implementation NSView (frameAsQuickDrawRect)
- (Rect)frameAsQuickDrawRect {
    NSRect  nsrect = [self convertRect:[self bounds] toView:[[self window] contentView]];
    float   windowHeight = NSHeight( [[[self window] contentView] frame] );
    
    float   nsrectHeight = NSHeight( nsrect );
    
    Rect qdrect;
    qdrect.top = windowHeight - (nsrect.origin.y + nsrectHeight);
    qdrect.left = nsrect.origin.x;
    qdrect.bottom = qdrect.top + nsrectHeight;
    qdrect.right = qdrect.left + NSWidth( nsrect );
    
    return qdrect;
}
@end
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS