Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. load mp3 and seek by samples

load mp3 and seek by samples

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    javad_2005
    wrote on last edited by
    #1

    hi i have one file of wave-Mpeg layer3 11025 16 channel 1. mciSendstring can be load this mp3 and play it but doenst work correctly when i get position by samples mcisendstring give me wrong. or give me wrong time . i want to load mp3 and seek by samples and get position by samples. do u have any way? thanks.

    Z 2 Replies Last reply
    0
    • J javad_2005

      hi i have one file of wave-Mpeg layer3 11025 16 channel 1. mciSendstring can be load this mp3 and play it but doenst work correctly when i get position by samples mcisendstring give me wrong. or give me wrong time . i want to load mp3 and seek by samples and get position by samples. do u have any way? thanks.

      Z Offline
      Z Offline
      zhu_lin
      wrote on last edited by
      #2

      hi,I used to player media file by using DirectShow SDK and work well.

      I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com

      J 1 Reply Last reply
      0
      • Z zhu_lin

        hi,I used to player media file by using DirectShow SDK and work well.

        I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com

        J Offline
        J Offline
        javad_2005
        wrote on last edited by
        #3

        thanks .but can be directshow sdk seek by samples.

        Z 1 Reply Last reply
        0
        • J javad_2005

          thanks .but can be directshow sdk seek by samples.

          Z Offline
          Z Offline
          zhu_lin
          wrote on last edited by
          #4

          of course. I can give you an example about playe media file. also you can find some examples in the sdk which must be useful for you.

          I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com

          1 Reply Last reply
          0
          • J javad_2005

            hi i have one file of wave-Mpeg layer3 11025 16 channel 1. mciSendstring can be load this mp3 and play it but doenst work correctly when i get position by samples mcisendstring give me wrong. or give me wrong time . i want to load mp3 and seek by samples and get position by samples. do u have any way? thanks.

            Z Offline
            Z Offline
            zhu_lin
            wrote on last edited by
            #5

            this is a MFC application, you scroll the slider and seek the position of the media file using DisrectShow.

            void CSimplePlayerDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
            {
            if (pScrollBar->GetSafeHwnd() == mSliderGraph.GetSafeHwnd())
            {
            if (mFilterGraph)
            {
            // Calculate the current seeking position
            double duration = 1.;
            mFilterGraph->GetDuration(&duration);
            double pos = duration * mSliderGraph.GetPos() / 1000.;
            mFilterGraph->SetCurrentPosition(pos);
            }
            }
            else
            {
            CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
            }
            }

            I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com

            J 1 Reply Last reply
            0
            • Z zhu_lin

              this is a MFC application, you scroll the slider and seek the position of the media file using DisrectShow.

              void CSimplePlayerDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
              {
              if (pScrollBar->GetSafeHwnd() == mSliderGraph.GetSafeHwnd())
              {
              if (mFilterGraph)
              {
              // Calculate the current seeking position
              double duration = 1.;
              mFilterGraph->GetDuration(&duration);
              double pos = duration * mSliderGraph.GetPos() / 1000.;
              mFilterGraph->SetCurrentPosition(pos);
              }
              }
              else
              {
              CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
              }
              }

              I'm from China ,it's my pleasure to make friend with you. msn:zhu_lin4103@126.com

              J Offline
              J Offline
              javad_2005
              wrote on last edited by
              #6

              seek by samples not by ms i means "time format samples" thanks

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups