Created
December 4, 2013 14:10
-
-
Save BitPuffin/7787980 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| proc openAudioFile*(path: string): ref PAudioFile = | |
| debug("Allocating TOggVorbisFile memory") | |
| var fileptr = cast[ptr TOggVorbisFile](alloc0(sizeof(TOggVorbisFile))) | |
| debug("Creating new PAudioFile object") | |
| new(result, close) | |
| result.file = fileptr | |
| debug("Opening vorbis file") | |
| if fopen(cstring(path), result.file) != 0: | |
| error("Opening file $1 failed!", path) | |
| raise newException(EIO, "Failed to open file ") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment