-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Bitrate can be roughly calculated by (file.fileAbstraction.size - file.tag.sizeOnDisk) * 8 / file.properties.duration
. Some files will return 0 when getting its bitrate, and make a fallback value for bitrate is needed IMO.
But that needs a new property on FileAbstraction
. Here is my implemention.
export class Stream {
// ...
public static getFileSize(path: string): number {
return fs.statSync(path).size
}
}
export interface IFileAbstraction {
// ...
/**
* Total size of file
*/
size: number;
}
export class FileAbstraction {
// ...
public get size(): number {
return Stream.getFileSize(this._name)
}
}
Metadata
Metadata
Assignees
Labels
No labels