Esempio n. 1
0
        private void MusicRecognisionSlin(AudioFileSlin a_musicFileSlin, List <string> a_orderListSlin)
        {
            string        m_filePathSlin = a_musicFileSlin.GetNewAudioFileNameSlin();
            List <string> m_fileDataSlin = a_musicFileSlin.tagDataFromFilesSlin;

            //Create recognise instance of API
            var m_musicRecognisionSlin = new MusicRecognisionSlin();

            //Send file to API
            m_musicRecognisionSlin.SendFileToApi(m_filePathSlin);

            //If the song is found
            if (m_musicRecognisionSlin.GetStatusSlin())
            {
                for (int indexSlin = 0; indexSlin < m_fileDataSlin.Count(); indexSlin++)
                {
                    if (m_fileDataSlin[indexSlin] == null)
                    {
                        //Set the empty value to the value from the Music Recognision
                        m_fileDataSlin[indexSlin] = m_musicRecognisionSlin.GetSpeceficResultDataSlin(a_orderListSlin[indexSlin]);
                    }
                }
            }

            a_musicFileSlin.tagDataFromFilesSlin = m_fileDataSlin;
        }
Esempio n. 2
0
        private bool Id3TagReaderSlin(AudioFileSlin a_audioFileSlin, List <string> a_orderListSlin)
        {
            try
            {
                string m_audioFilePathSlin = a_audioFileSlin.GetNewAudioFileNameSlin(); //get the audioFilePath
                var    m_id3TagReaderSlin  = new Id3TagReaderSlin(m_audioFilePathSlin, a_orderListSlin);

                a_audioFileSlin.tagDataFromFilesSlin = m_id3TagReaderSlin.GetDataForFile();

                return(true);
            }
            catch
            {
                MessageBox.Show("Sorry! Something went wrong! Contact the company for more info.");
                return(false);
            }
        }