This file contains 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
def b64len(b64str): | |
""" | |
Calculate the length in bytes of a base64 string. | |
This function could decode the base64 string to a binary blob and count its | |
number of bytes with len(). But, that's inefficient and requires more | |
memory that really needed. | |
Base64 encodes three bytes to four characters. Sometimes, padding is added | |
in the form of one or two '=' characters. |
This file contains 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
/* | |
* Simple sound playback using ALSA API and libasound. | |
* | |
* Compile: | |
* $ cc -o play sound_playback.c -lasound | |
* | |
* Usage: | |
* $ ./play <sample_rate> <channels> <seconds> < <file> | |
* | |
* Examples: |