libgroove  5.0.0
loudness.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Andrew Kelley
3  *
4  * This file is part of libgroove, which is MIT licensed.
5  * See http://opensource.org/licenses/MIT
6  */
7 
8 #ifndef GROOVE_LOUDNESS_H
9 #define GROOVE_LOUDNESS_H
10 
11 #include <groove/groove.h>
12 
21  double loudness;
23  double peak;
25  double duration;
26 
33 };
34 
42 
46 
50 
53 };
54 
56 GROOVE_EXPORT void groove_loudness_detector_destroy(struct GrooveLoudnessDetector *detector);
57 
59 GROOVE_EXPORT int groove_loudness_detector_attach(struct GrooveLoudnessDetector *detector,
60  struct GroovePlaylist *playlist);
61 GROOVE_EXPORT int groove_loudness_detector_detach(struct GrooveLoudnessDetector *detector);
62 
65 GROOVE_EXPORT int groove_loudness_detector_info_get(struct GrooveLoudnessDetector *detector,
66  struct GrooveLoudnessDetectorInfo *info, int block);
67 
70 GROOVE_EXPORT int groove_loudness_detector_info_peek(struct GrooveLoudnessDetector *detector,
71  int block);
72 
77 GROOVE_EXPORT void groove_loudness_detector_position(struct GrooveLoudnessDetector *detector,
78  struct GroovePlaylistItem **item, double *seconds);
79 
80 #endif
void groove_loudness_detector_position(struct GrooveLoudnessDetector *detector, struct GroovePlaylistItem **item, double *seconds)
get the position of the detect head both the current playlist item and the position in seconds in the...
void groove_loudness_detector_destroy(struct GrooveLoudnessDetector *detector)
int disable_album
set to 1 to only compute track loudness.
Definition: loudness.h:49
Definition: loudness.h:13
int groove_loudness_detector_info_get(struct GrooveLoudnessDetector *detector, struct GrooveLoudnessDetectorInfo *info, int block)
returns < 0 on error, 0 on aborted (block=1) or no info ready (block=0), 1 on info returned ...
Definition: groove.h:118
struct GroovePlaylistItem * item
if item is NULL, this info applies to all songs analyzed until this point.
Definition: loudness.h:32
double peak
peak amplitude in float format
Definition: loudness.h:23
int info_queue_size
maximum number of GrooveLoudnessDetectorInfo items to store in this loudness detector's queue...
Definition: loudness.h:41
int groove_loudness_detector_attach(struct GrooveLoudnessDetector *detector, struct GroovePlaylist *playlist)
once you attach, you must detach before destroying the playlist
int sink_buffer_size
how big the sink buffer should be, in sample frames.
Definition: loudness.h:45
int groove_loudness_detector_info_peek(struct GrooveLoudnessDetector *detector, int block)
returns < 0 on error, 0 on no info ready, 1 on info ready if block is 1, block until info is ready ...
Definition: groove.h:144
double loudness
loudness is in LUFS.
Definition: loudness.h:21
struct GrooveLoudnessDetector * groove_loudness_detector_create(void)
int groove_loudness_detector_detach(struct GrooveLoudnessDetector *detector)
struct GroovePlaylist * playlist
read-only. set when attached and cleared when detached
Definition: loudness.h:52
double duration
how many seconds long this song is
Definition: loudness.h:25
Definition: loudness.h:35