:param path_in_ipod: the path of audio file in the iPod base
        :param checksum: CHECKSUM of the audio file in member audiodb
        :return: a new Track, you may want append it to the playlist.tracks
507756
def create_track(self, path_in_ipod=None, checksum=None):
        
        if bool(path_in_ipod) == bool(checksum):
            raise Exception

        if not path_in_ipod:
            path_in_ipod = self.audiodb.get_voice(checksum)

        track = Track(self, path_in_ipod=path_in_ipod)

        return track
1163892
function getItunesTracks(librarypath) {
    var libraryID;
    var trackObj = {};
    var isTrack = false;
    var line;
    var trackCount = 0;
    var streamIn;
    var streamOut = new stream_1.Readable;
    streamOut._read = function () { };
    streamIn = fs.createReadStream(librarypath);
    streamIn.on('error', function () { return streamOut.emit("error", 'The file you selected does not exist'); });
    streamIn = byline.createStream(streamIn);
    /*
    if (!module.exports.validPath(librarypath)) {
        streamOut.emit("error", 'Not a valid XML file')
    }
    */
    streamIn.on('readable', function () {
        while (null !== (line = streamIn.read())) {
            if (line.indexOf("<key>Library Persistent ID</key>") > -1) {
                /* ADD A KEY/VALUE PROPERTY */
                var iDString = String(line).match("<key>Library Persistent ID</key><string>(.*)</string>");
                libraryID = iDString[1];
            }
            else if (line.indexOf("<dict>") > -1) {
                /* START A NEW TRACK */
                trackObj = {};
                isTrack = true;
            }
            else if (line.indexOf("<key>") > -1) {
                /* ADD A PROPERTY TO THE TRACK */
                Object.assign(trackObj, module.exports.buildProperty(line));
            }
            else if (line.indexOf("</dict>") > -1) {
                /* END OF CURRENT TRACK */
                if (module.exports.objectIsMusicTrack(trackObj)) {
                    trackObj['Library Persistent ID'] = libraryID; //add extra metadata
                    trackCount++;
                    streamOut.push(JSON.stringify(trackObj));
                }
                isTrack = false;
            }
        }
    });
    streamIn.on('end', function () {
        if (trackCount == 0)
            streamOut.emit("error", 'No tracks exist in the file');
        trackCount = 0; //reset it
        streamOut.push(null);
    });
    streamIn.on('error', function (err) {
        streamOut.emit("error", 'Error parsing iTunes XML');
    });
    return streamOut;
}
1009001
def add_to_playlist(self, items, playlist='video'):
        '''
        '''
        playlists = {'music': 0, 'video': 1}
        assert playlist in playlists.keys(), ('Playlist "%s" is invalid.' %
                                              playlist)
        selected_playlist = xbmc.PlayList(playlists[playlist])

        _items = []
        for item in items:
            if not hasattr(item, 'as_xbmc_listitem'):
                if 'info_type' in item.keys():
                    log.warning('info_type key has no affect for playlist '
                                'items as the info_type is inferred from the '
                                'playlist type.')
                # info_type has to be same as the playlist type
                item['info_type'] = playlist
                item = xbmcswift2.ListItem.from_dict(**item)
            _items.append(item)
            selected_playlist.add(item.get_path(), item.as_xbmc_listitem())
        return _items
713566
function(track) {
  var request = new XMLHttpRequest()
  request.open('GET', 'sounds/' + track + '.wav', true)
  request.responseType = 'arraybuffer'
  request.onload = function() {
    context.decodeAudioData(request.response, function(buffer) {
      var createNode = function() {
        var node = context.createBufferSource()
        node.buffer = buffer
        node.connect(context.destination)
        return node
      }
      soundBank[track] = { createNode: createNode }
    })
  }
  request.send()
}
444803
function getChecksum(fs, path, callback) {
  fs.readFile(path, function(err, data) {
    if(!err) {
      callback(null, md5sum(data));
    } else if(err.code === 'ENOENT') {
      // File does not exist so the checksum is an empty string
      callback(null, "");
    } else {
      callback(err);
    }
  });
}
1090144
def _checksum_paths():
  """"""
  dataset2path = {}
  for dir_path in _CHECKSUM_DIRS:
    for fname in _list_dir(dir_path):
      if not fname.endswith(_CHECKSUM_SUFFIX):
        continue
      fpath = os.path.join(dir_path, fname)
      dataset_name = fname[:-len(_CHECKSUM_SUFFIX)]
      dataset2path[dataset_name] = fpath
  return dataset2path
656901
def remove_checksum(path):
    

    path = '{}.md5sum'.format(path)
    if os.path.exists(path):
        os.remove(path)
740000
def listtracks(continuation_token: nil)
      oauth2_refresh_access_token if oauth2_access_token_expired?

      pb_body = MusicManager::ExportTracksRequest.new
      pb_body.client_id = uploader_id
      pb_body.export_type = MusicManager::ExportTracksRequest::TrackType::ALL
      pb_body.continuation_token = continuation_token unless continuation_token.nil?

      uri = URI('https://music.google.com/music/exportids')

      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true

      req = Net::HTTP::Post.new(uri.path)
      req.body = pb_body.serialize_to_string
      req['Content-Type'] = 'application/x-google-protobuf'
      req['Authorization'] = oauth2_authentication_header
      req['X-Device-ID'] = uploader_id
      res = http.request(req)

      unless res.is_a? Net::HTTPSuccess
        fail Error, 'listtracks failed: #{res.code}'
      end

      MusicManager::ExportTracksResponse.new.parse_from_string(res.body)
    end
654295
def add_tagfile(self, path, timestamp=None):
        # type: (Text, datetime.datetime) -> None
        """"""
        self.self_check()
        checksums = {}
        # Read file to calculate its checksum
        if os.path.isdir(path):
            return
            # FIXME: do the right thing for directories
        with open(path, "rb") as tag_file:
            # FIXME: Should have more efficient open_tagfile() that
            # does all checksums in one go while writing through,
            # adding checksums after closing.
            # Below probably OK for now as metadata files
            # are not too large..?

            checksums[SHA1] = checksum_copy(tag_file, hasher=hashlib.sha1)

            tag_file.seek(0)
            checksums[SHA256] = checksum_copy(tag_file, hasher=hashlib.sha256)

            tag_file.seek(0)
            checksums[SHA512] = checksum_copy(tag_file, hasher=hashlib.sha512)

        rel_path = _posix_path(os.path.relpath(path, self.folder))
        self.tagfiles.add(rel_path)
        self.add_to_manifest(rel_path, checksums)
        if timestamp is not None:
            self._file_provenance[rel_path] = {"createdOn": timestamp.isoformat()}
69606
def rewrite_asset_path(source, path = nil)
      if Fingerjam::Base.enabled? && Fingerjam::Base.cached?(source)
        Fingerjam::Base.cached_url(source)
      else
        if path && path.respond_to?(:call)
          return path.call(source)
        elsif path && path.is_a?(String)
          return path % [source]
        end

        asset_id = rails_asset_id(source)
        if asset_id.blank?
          source
        else
          source + "?#{asset_id}"
        end
      end
    end
1281777
def checksum(self, path, hashtype='sha1'):
        """"""
        return self._handler.checksum(hashtype, posix_path(path))
148445
public void addTrack(SoundCloudTrack track, boolean playNow) {
        checkState();
        mPlayerPlaylist.add(track);
        for (CheerleaderPlaylistListener listener : mCheerleaderPlaylistListeners) {
            listener.onTrackAdded(track);
        }
        if (playNow) {
            play(mPlayerPlaylist.size() - 1);
        }
    }
170489
function _checksums(dir) {
  const checksums = {};

  glob.sync(resolve(dir, '**/!(*.pack.+(s[ac]ss|js))'), { mark: true }).forEach((file) => {
    if (Utils.endsWith(file, '/')) { return; }

    const relativePath = relative(dir, file);
    checksums[relativePath] = Utils.checksum(file);
  });

  return checksums;
}
451473
def save_indexed_audio(self, indexed_audio_file_abs_path):
        
        with open(indexed_audio_file_abs_path, "wb") as f:
            pickle.dump(self.get_timestamps(), f, pickle.HIGHEST_PROTOCOL)
267209
function add(track, playbackSuccess, playbackError, statusChange, progressChange) {
        if (!track.url) {
            console.log('ionic-audio: missing track url');
            return;
        }

        angular.extend(track, {
            onSuccess: playbackSuccess,
            onError: playbackError,
            onStatusChange: statusChange,
            onProgress: progressChange,
            status: 0,
            duration: -1,
            progress: 0
        });

        if (find(track)) {
            return track.id;
        }

        track.id  = tracks.push(track) - 1;
        return track.id;
    }
1214471
def _join_summary_file(data, summary_filename="msd_summary_file.h5"):
    
    msd = h5py.File(summary_filename)

    # create a lookup table of trackid -> position
    track_lookup = dict((t.encode("utf8"), i) for i, t in enumerate(data['track'].cat.categories))

    # join on trackid to the summary file to get the artist/album/songname
    track_info = np.empty(shape=(len(track_lookup), 4), dtype=np.object)
    with tqdm.tqdm(total=len(track_info)) as progress:
        for song in msd['metadata']['songs']:
            trackid = song[17]
            if trackid in track_lookup:
                pos = track_lookup[trackid]
                track_info[pos] = [x.decode("utf8") for x in (trackid, song[9], song[14], song[18])]
                progress.update(1)

    return track_info
275163
def check_path(self, path):
        
        path = os.path.abspath(path)
        if os.path.exists(path):
            return path
        else:
            utils.die("input file does not exists:\n  {}".format(path))